diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperations.cs index 86cf68db7709..da18d8b19768 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperations.cs @@ -62,24 +62,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2025-10-15"; + + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -87,7 +81,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -97,12 +90,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -197,7 +190,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -261,23 +254,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -293,7 +281,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -302,7 +289,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -312,13 +298,13 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -413,7 +399,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -486,17 +472,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -531,7 +512,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +521,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -551,14 +530,14 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -691,7 +670,8 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The name of the resource group. The name is case insensitive. @@ -699,22 +679,25 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// + /// + /// The properties specifying the desired state of the managed Cassandra + /// cluster. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -723,8 +706,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// Managed Cassandra cluster name. /// /// - /// The properties specifying the desired state of the managed Cassandra - /// cluster. + /// Parameters to provide for specifying the managed Cassandra cluster. /// /// /// Headers that will be added to request. @@ -732,15 +714,15 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -748,24 +730,24 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// - /// - /// Parameters to provide for specifying the managed Cassandra cluster. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -773,8 +755,9 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// - /// - /// Specification which command to run where + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss /// /// /// Headers that will be added to request. @@ -782,18 +765,15 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> InvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginInvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, xMsForceDeallocate, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The name of the resource group. The name is case insensitive. @@ -801,16 +781,19 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// + /// + /// Specification which command to run where + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> InvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginInvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -832,10 +815,10 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -876,17 +859,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -921,7 +899,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -931,7 +908,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -941,14 +917,14 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1081,7 +1057,8 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The name of the resource group. The name is case insensitive. @@ -1089,6 +1066,10 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// + /// + /// The properties specifying the desired state of the managed Cassandra + /// cluster. + /// /// /// Headers that will be added to request. /// @@ -1098,6 +1079,9 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -1107,23 +1091,23 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (body == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1158,7 +1142,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1168,24 +1151,24 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1194,7 +1177,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1223,6 +1206,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -1245,7 +1234,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1280,7 +1269,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1288,6 +1277,55 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1300,8 +1338,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -1310,8 +1347,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// Managed Cassandra cluster name. /// /// - /// The properties specifying the desired state of the managed Cassandra - /// cluster. + /// Parameters to provide for specifying the managed Cassandra cluster. /// /// /// Headers that will be added to request. @@ -1334,7 +1370,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1344,18 +1380,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1390,7 +1420,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1400,25 +1429,24 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1427,7 +1455,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1484,7 +1512,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1519,7 +1547,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1546,7 +1574,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -1563,6 +1591,19 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1575,7 +1616,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -1583,9 +1624,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// - /// - /// Parameters to provide for specifying the managed Cassandra cluster. - /// /// /// Headers that will be added to request. /// @@ -1595,9 +1633,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1607,27 +1642,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (body == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1662,7 +1688,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1672,25 +1697,23 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1699,7 +1722,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1728,12 +1751,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -1756,7 +1773,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1791,7 +1808,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1799,41 +1816,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - // Deserialize Response - if ((int)_statusCode == 202) + catch (Newtonsoft.Json.JsonException ex) { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -1847,7 +1841,10 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -1855,8 +1852,9 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// - /// - /// Specification which command to run where + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss /// /// /// Headers that will be added to request. @@ -1867,9 +1865,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1879,31 +1874,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginInvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (body == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); - } - if (body != null) - { - body.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1938,7 +1920,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1948,25 +1930,24 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("xMsForceDeallocate", xMsForceDeallocate); - tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginInvokeCommand", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1990,6 +1971,14 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } + if (xMsForceDeallocate != null) + { + if (_httpRequest.Headers.Contains("x-ms-force-deallocate")) + { + _httpRequest.Headers.Remove("x-ms-force-deallocate"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-force-deallocate", xMsForceDeallocate); + } if (customHeaders != null) { @@ -2004,12 +1993,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2067,7 +2050,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2075,23 +2058,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 202) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -2105,10 +2083,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The name of the resource group. The name is case insensitive. @@ -2116,6 +2091,9 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Managed Cassandra cluster name. /// + /// + /// Specification which command to run where + /// /// /// Headers that will be added to request. /// @@ -2125,6 +2103,9 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2134,23 +2115,26 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginInvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (body == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (this.Client.SubscriptionId != null) + if (body != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + body.Validate(); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2185,7 +2169,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2195,24 +2178,24 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeallocate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginInvokeCommand", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2250,6 +2233,12 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -2272,7 +2261,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2307,7 +2296,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2315,6 +2304,55 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2356,23 +2394,18 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2407,7 +2440,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2417,7 +2449,6 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -2427,14 +2458,14 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2529,7 +2560,7 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2537,6 +2568,383 @@ internal CassandraClustersOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List all managed Cassandra clusters in this subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List all managed Cassandra clusters in this resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperationsExtensions.cs index 0e8cbee93ed2..655ae56f1797 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraClustersOperationsExtensions.cs @@ -18,7 +18,7 @@ public static partial class CassandraClustersOperationsExtensions /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable ListBySubscription(this ICassandraClustersOperations operations) + public static Microsoft.Rest.Azure.IPage ListBySubscription(this ICassandraClustersOperations operations) { return ((ICassandraClustersOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); } @@ -32,7 +32,7 @@ public static System.Collections.Generic.IEnumerable ListBySubs /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ICassandraClustersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this ICassandraClustersOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -48,7 +48,7 @@ public static System.Collections.Generic.IEnumerable ListBySubs /// /// The name of the resource group. The name is case insensitive. /// - public static System.Collections.Generic.IEnumerable ListByResourceGroup(this ICassandraClustersOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this ICassandraClustersOperations operations, string resourceGroupName) { return ((ICassandraClustersOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); } @@ -65,7 +65,7 @@ public static System.Collections.Generic.IEnumerable ListByReso /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ICassandraClustersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this ICassandraClustersOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -112,7 +112,8 @@ public static ClusterResource Get(this ICassandraClustersOperations operations, } } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -123,13 +124,14 @@ public static ClusterResource Get(this ICassandraClustersOperations operations, /// /// Managed Cassandra cluster name. /// - public static void Delete(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static ClusterResource CreateUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) { - ((ICassandraClustersOperations)operations).DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).CreateUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -143,13 +145,15 @@ public static void Delete(this ICassandraClustersOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -160,14 +164,13 @@ public static void Delete(this ICassandraClustersOperations operations, string r /// /// Managed Cassandra cluster name. /// - public static ClusterResource CreateUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) + public static ClusterResource Update(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) { - return ((ICassandraClustersOperations)operations).CreateUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).UpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -181,15 +184,15 @@ public static ClusterResource CreateUpdate(this ICassandraClustersOperations ope /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -200,13 +203,13 @@ public static ClusterResource CreateUpdate(this ICassandraClustersOperations ope /// /// Managed Cassandra cluster name. /// - public static ClusterResource Update(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) + public static CassandraClustersDeleteHeaders Delete(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) { - return ((ICassandraClustersOperations)operations).UpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -220,15 +223,18 @@ public static ClusterResource Update(this ICassandraClustersOperations operation /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The operations group for this extension method. @@ -239,13 +245,20 @@ public static ClusterResource Update(this ICassandraClustersOperations operation /// /// Managed Cassandra cluster name. /// - public static CommandOutput InvokeCommand(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body) + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// + public static CassandraClustersDeallocateHeaders Deallocate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string)) { - return ((ICassandraClustersOperations)operations).InvokeCommandAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).DeallocateAsync(resourceGroupName, clusterName, xMsForceDeallocate).GetAwaiter().GetResult(); } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The operations group for this extension method. @@ -256,21 +269,22 @@ public static CommandOutput InvokeCommand(this ICassandraClustersOperations oper /// /// Managed Cassandra cluster name. /// + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task InvokeCommandAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeallocateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.InvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, xMsForceDeallocate, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The operations group for this extension method. @@ -281,16 +295,13 @@ public static CommandOutput InvokeCommand(this ICassandraClustersOperations oper /// /// Managed Cassandra cluster name. /// - public static void Deallocate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static CommandOutput InvokeCommand(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body) { - ((ICassandraClustersOperations)operations).DeallocateAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).InvokeCommandAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The operations group for this extension method. @@ -304,9 +315,12 @@ public static void Deallocate(this ICassandraClustersOperations operations, stri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeallocateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task InvokeCommandAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.InvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will @@ -323,9 +337,9 @@ public static void Deallocate(this ICassandraClustersOperations operations, stri /// /// Managed Cassandra cluster name. /// - public static void Start(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static CassandraClustersStartHeaders Start(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) { - ((ICassandraClustersOperations)operations).StartAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).StartAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); } /// @@ -346,9 +360,12 @@ public static void Start(this ICassandraClustersOperations operations, string re /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task StartAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task StartAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.StartWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in @@ -392,7 +409,8 @@ public static CassandraClusterPublicStatus Status(this ICassandraClustersOperati } } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -403,13 +421,14 @@ public static CassandraClusterPublicStatus Status(this ICassandraClustersOperati /// /// Managed Cassandra cluster name. /// - public static void BeginDelete(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static ClusterResource BeginCreateUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) { - ((ICassandraClustersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginCreateUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Deletes a managed Cassandra cluster. + /// Create or update a managed Cassandra cluster. When updating, you must + /// specify all writable properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -423,13 +442,15 @@ public static void BeginDelete(this ICassandraClustersOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -440,14 +461,13 @@ public static void BeginDelete(this ICassandraClustersOperations operations, str /// /// Managed Cassandra cluster name. /// - public static ClusterResource BeginCreateUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) + public static ClusterResource BeginUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) { - return ((ICassandraClustersOperations)operations).BeginCreateUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Create or update a managed Cassandra cluster. When updating, you must - /// specify all writable properties. To update only some properties, use PATCH. + /// Updates some of the properties of a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -461,15 +481,15 @@ public static ClusterResource BeginCreateUpdate(this ICassandraClustersOperation /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -480,13 +500,13 @@ public static ClusterResource BeginCreateUpdate(this ICassandraClustersOperation /// /// Managed Cassandra cluster name. /// - public static ClusterResource BeginUpdate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body) + public static CassandraClustersDeleteHeaders BeginDelete(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) { - return ((ICassandraClustersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); } /// - /// Updates some of the properties of a managed Cassandra cluster. + /// Deletes a managed Cassandra cluster. /// /// /// The operations group for this extension method. @@ -500,15 +520,18 @@ public static ClusterResource BeginUpdate(this ICassandraClustersOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, ClusterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The operations group for this extension method. @@ -519,13 +542,20 @@ public static ClusterResource BeginUpdate(this ICassandraClustersOperations oper /// /// Managed Cassandra cluster name. /// - public static CommandOutput BeginInvokeCommand(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body) + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// + public static CassandraClustersDeallocateHeaders BeginDeallocate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string)) { - return ((ICassandraClustersOperations)operations).BeginInvokeCommandAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginDeallocateAsync(resourceGroupName, clusterName, xMsForceDeallocate).GetAwaiter().GetResult(); } /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. + /// Deallocation will deallocate the host virtual machine of this cluster, and + /// reserved the data disk. This won't do anything on an already deallocated + /// cluster. Use Start to restart the cluster. /// /// /// The operations group for this extension method. @@ -536,21 +566,22 @@ public static CommandOutput BeginInvokeCommand(this ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginInvokeCommandAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeallocateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginInvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, xMsForceDeallocate, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The operations group for this extension method. @@ -561,16 +592,13 @@ public static CommandOutput BeginInvokeCommand(this ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// - public static void BeginDeallocate(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static CommandOutput BeginInvokeCommand(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body) { - ((ICassandraClustersOperations)operations).BeginDeallocateAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginInvokeCommandAsync(resourceGroupName, clusterName, body).GetAwaiter().GetResult(); } /// - /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. - /// Deallocation will deallocate the host virtual machine of this cluster, and - /// reserved the data disk. This won't do anything on an already deallocated - /// cluster. Use Start to restart the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The operations group for this extension method. @@ -584,9 +612,12 @@ public static void BeginDeallocate(this ICassandraClustersOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeallocateAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginInvokeCommandAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, CommandPostBody body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeallocateWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginInvokeCommandWithHttpMessagesAsync(resourceGroupName, clusterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will @@ -603,9 +634,9 @@ public static void BeginDeallocate(this ICassandraClustersOperations operations, /// /// Managed Cassandra cluster name. /// - public static void BeginStart(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) + public static CassandraClustersStartHeaders BeginStart(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName) { - ((ICassandraClustersOperations)operations).BeginStartAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + return ((ICassandraClustersOperations)operations).BeginStartAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); } /// @@ -626,9 +657,78 @@ public static void BeginStart(this ICassandraClustersOperations operations, stri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginStartAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginStartAsync(this ICassandraClustersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// List all managed Cassandra clusters in this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this ICassandraClustersOperations operations, string nextPageLink) + { + return ((ICassandraClustersOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all managed Cassandra clusters in this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this ICassandraClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// List all managed Cassandra clusters in this resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this ICassandraClustersOperations operations, string nextPageLink) + { + return ((ICassandraClustersOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all managed Cassandra clusters in this resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this ICassandraClustersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperations.cs index 0834fe76349e..aae22eb197f5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperations.cs @@ -68,23 +68,18 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "clusterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +123,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -139,14 +132,14 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -241,7 +234,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -317,17 +310,12 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -381,7 +369,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataCenterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -392,7 +379,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("dataCenterName", dataCenterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -402,15 +388,15 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{dataCenterName}", System.Uri.EscapeDataString(dataCenterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -543,7 +529,8 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The name of the resource group. The name is case insensitive. @@ -554,22 +541,24 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Data center name in a managed Cassandra cluster. /// + /// + /// Parameters specifying the managed Cassandra data center. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The name of the resource group. The name is case insensitive. @@ -581,7 +570,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// Data center name in a managed Cassandra cluster. /// /// - /// Parameters specifying the managed Cassandra data center. + /// Parameters to provide for specifying the managed Cassandra data center. /// /// /// Headers that will be added to request. @@ -589,15 +578,15 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The name of the resource group. The name is case insensitive. @@ -608,24 +597,22 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Data center name in a managed Cassandra cluster. /// - /// - /// Parameters to provide for specifying the managed Cassandra data center. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The name of the resource group. The name is case insensitive. @@ -636,6 +623,9 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Data center name in a managed Cassandra cluster. /// + /// + /// Parameters specifying the managed Cassandra data center. + /// /// /// Headers that will be added to request. /// @@ -645,6 +635,9 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -654,23 +647,23 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (body == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -724,7 +717,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataCenterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -735,25 +727,25 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("dataCenterName", dataCenterName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{dataCenterName}", System.Uri.EscapeDataString(dataCenterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -762,7 +754,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -791,6 +783,12 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -813,7 +811,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -848,7 +846,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -856,6 +854,55 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -868,8 +915,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The name of the resource group. The name is case insensitive. @@ -881,7 +927,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// Data center name in a managed Cassandra cluster. /// /// - /// Parameters specifying the managed Cassandra data center. + /// Parameters to provide for specifying the managed Cassandra data center. /// /// /// Headers that will be added to request. @@ -904,7 +950,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -914,18 +960,12 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -979,7 +1019,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataCenterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -990,26 +1029,25 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("dataCenterName", dataCenterName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{dataCenterName}", System.Uri.EscapeDataString(dataCenterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1018,7 +1056,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1075,7 +1113,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1110,7 +1148,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1137,7 +1175,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -1154,6 +1192,19 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1166,7 +1217,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The name of the resource group. The name is case insensitive. @@ -1177,9 +1228,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Data center name in a managed Cassandra cluster. /// - /// - /// Parameters to provide for specifying the managed Cassandra data center. - /// /// /// Headers that will be added to request. /// @@ -1189,9 +1237,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1201,27 +1246,18 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (body == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1275,7 +1311,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "dataCenterName", "^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1286,26 +1321,24 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("dataCenterName", dataCenterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{dataCenterName}", System.Uri.EscapeDataString(dataCenterName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1314,7 +1347,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1343,12 +1376,6 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -1371,7 +1398,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1406,7 +1433,7 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1414,31 +1441,190 @@ internal CassandraDataCentersOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _httpResponse.Dispose(); } - catch (Newtonsoft.Json.JsonException ex) + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List all data centers in a particular managed Cassandra cluster. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) { - _httpRequest.Dispose(); - if (_httpResponse != null) + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + } + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) { - _httpResponse.Dispose(); + _httpRequest.Headers.Remove(_header.Key); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + // Serialize Request + string _requestContent = null; + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 == 202) + if ((int)_statusCode == 200) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperationsExtensions.cs index 7099f31bdb5a..c44f950e0520 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraDataCentersOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class CassandraDataCentersOperationsExtensions /// /// Managed Cassandra cluster name. /// - public static System.Collections.Generic.IEnumerable List(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName) + public static Microsoft.Rest.Azure.IPage List(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName) { return ((ICassandraDataCentersOperations)operations).ListAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable List(th /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) { @@ -97,7 +97,8 @@ public static DataCenterResource Get(this ICassandraDataCentersOperations operat } } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -111,13 +112,14 @@ public static DataCenterResource Get(this ICassandraDataCentersOperations operat /// /// Data center name in a managed Cassandra cluster. /// - public static void Delete(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName) + public static DataCenterResource CreateUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) { - ((ICassandraDataCentersOperations)operations).DeleteAsync(resourceGroupName, clusterName, dataCenterName).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).CreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -134,13 +136,15 @@ public static void Delete(this ICassandraDataCentersOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.CreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -154,14 +158,13 @@ public static void Delete(this ICassandraDataCentersOperations operations, strin /// /// Data center name in a managed Cassandra cluster. /// - public static DataCenterResource CreateUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) + public static DataCenterResource Update(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) { - return ((ICassandraDataCentersOperations)operations).CreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).UpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -178,15 +181,15 @@ public static DataCenterResource CreateUpdate(this ICassandraDataCentersOperatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -200,13 +203,13 @@ public static DataCenterResource CreateUpdate(this ICassandraDataCentersOperatio /// /// Data center name in a managed Cassandra cluster. /// - public static DataCenterResource Update(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) + public static CassandraDataCentersDeleteHeaders Delete(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName) { - return ((ICassandraDataCentersOperations)operations).UpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).DeleteAsync(resourceGroupName, clusterName, dataCenterName).GetAwaiter().GetResult(); } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -223,15 +226,16 @@ public static DataCenterResource Update(this ICassandraDataCentersOperations ope /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -245,13 +249,14 @@ public static DataCenterResource Update(this ICassandraDataCentersOperations ope /// /// Data center name in a managed Cassandra cluster. /// - public static void BeginDelete(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName) + public static DataCenterResource BeginCreateUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) { - ((ICassandraDataCentersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName, dataCenterName).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).BeginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); } /// - /// Delete a managed Cassandra data center. + /// Create or update a managed Cassandra data center. When updating, overwrite + /// all properties. To update only some properties, use PATCH. /// /// /// The operations group for this extension method. @@ -268,13 +273,15 @@ public static void BeginDelete(this ICassandraDataCentersOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -288,14 +295,13 @@ public static void BeginDelete(this ICassandraDataCentersOperations operations, /// /// Data center name in a managed Cassandra cluster. /// - public static DataCenterResource BeginCreateUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) + public static DataCenterResource BeginUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) { - return ((ICassandraDataCentersOperations)operations).BeginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); } /// - /// Create or update a managed Cassandra data center. When updating, overwrite - /// all properties. To update only some properties, use PATCH. + /// Update some of the properties of a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -312,15 +318,15 @@ public static DataCenterResource BeginCreateUpdate(this ICassandraDataCentersOpe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -334,13 +340,13 @@ public static DataCenterResource BeginCreateUpdate(this ICassandraDataCentersOpe /// /// Data center name in a managed Cassandra cluster. /// - public static DataCenterResource BeginUpdate(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body) + public static CassandraDataCentersDeleteHeaders BeginDelete(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName) { - return ((ICassandraDataCentersOperations)operations).BeginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).GetAwaiter().GetResult(); + return ((ICassandraDataCentersOperations)operations).BeginDeleteAsync(resourceGroupName, clusterName, dataCenterName).GetAwaiter().GetResult(); } /// - /// Update some of the properties of a managed Cassandra data center. + /// Delete a managed Cassandra data center. /// /// /// The operations group for this extension method. @@ -357,9 +363,42 @@ public static DataCenterResource BeginUpdate(this ICassandraDataCentersOperation /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ICassandraDataCentersOperations operations, string resourceGroupName, string clusterName, string dataCenterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, dataCenterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// List all data centers in a particular managed Cassandra cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ICassandraDataCentersOperations operations, string nextPageLink) + { + return ((ICassandraDataCentersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all data centers in a particular managed Cassandra cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ICassandraDataCentersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperations.cs index e3a3ecbf0824..7ba8b8785276 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperations.cs @@ -69,23 +69,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListCassandraKeyspacesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListCassandraKeyspacesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -120,7 +115,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +124,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -140,14 +133,14 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -209,14 +202,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +218,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -242,7 +230,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -319,17 +307,12 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -369,7 +352,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -380,7 +362,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); @@ -390,15 +371,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -460,14 +441,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -477,10 +457,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -584,8 +560,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -617,23 +593,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListCassandraTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -673,7 +644,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -684,25 +654,24 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraKeyspaceThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraTables", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -764,14 +733,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -781,10 +749,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -797,7 +761,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -811,7 +775,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -835,88 +799,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// Keyspace. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// Gets the Cassandra table under an existing Azure Cosmos DB database /// account. /// /// @@ -928,6 +811,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// Headers that will be added to request. /// @@ -949,23 +835,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListCassandraTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1005,7 +886,11 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2025-10-15"; + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,25 +901,26 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraTables", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1096,14 +982,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1113,10 +998,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1129,7 +1010,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1143,7 +1024,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1167,8 +1048,67 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Create or update an Azure Cosmos DB Cassandra Table + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// The parameters to provide for the current Cassandra Table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -1203,23 +1143,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1264,7 +1199,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1276,26 +1210,25 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTableThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1357,14 +1290,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1374,10 +1306,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1390,7 +1318,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1404,7 +1332,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1428,7 +1356,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// /// The name of the resource group. The name is case insensitive. @@ -1442,24 +1370,26 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// - /// - /// The parameters to provide for the current Cassandra Table. - /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// table. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -1479,16 +1409,16 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the RUs per second of the Cassandra table under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1508,6 +1438,32 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// + public async System.Threading.Tasks.Task> MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure + /// Cosmos DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// /// /// Thrown when the operation returned an invalid status code /// @@ -1523,23 +1479,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1579,12 +1530,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - if (tableName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1595,27 +1540,24 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraTableThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraKeyspaceThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1677,14 +1619,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1694,10 +1635,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1748,7 +1685,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// /// The name of the resource group. The name is case insensitive. @@ -1759,12 +1696,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The RUs per second of the parameters to provide for the current Cassandra - /// table. + /// Keyspace. /// /// /// Headers that will be added to request. @@ -1772,15 +1706,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to /// autoscale /// /// @@ -1792,24 +1726,21 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual /// throughput /// /// @@ -1821,24 +1752,21 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update an Azure Cosmos DB Cassandra keyspace + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. /// /// /// The name of the resource group. The name is case insensitive. @@ -1846,12 +1774,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// The parameters to provide for the current Cassandra keyspace. - /// /// /// Headers that will be added to request. /// @@ -1873,31 +1795,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListCassandraRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateCassandraKeyspaceParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraKeyspaceParameters"); - } - if (createUpdateCassandraKeyspaceParameters != null) - { - createUpdateCassandraKeyspaceParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1932,12 +1841,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (keyspaceName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1947,27 +1850,23 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateCassandraKeyspaceParameters", createUpdateCassandraKeyspaceParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraKeyspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraRoleAssignments", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1976,7 +1875,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2005,12 +1904,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateCassandraKeyspaceParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraKeyspaceParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2033,16 +1926,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2052,10 +1944,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2068,7 +1956,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2082,7 +1970,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2094,19 +1982,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2119,7 +1994,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -2127,8 +2003,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -2139,6 +2015,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2148,23 +2027,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2199,12 +2073,11 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (keyspaceName == null) + if (roleAssignmentId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2214,26 +2087,25 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraKeyspace", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2242,7 +2114,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2293,16 +2165,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2312,10 +2183,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2328,7 +2195,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2336,18 +2203,23 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) + // Deserialize Response + if ((int)_statusCode == 200) { - _httpRequest.Dispose(); - if (_httpResponse != null) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try { - _httpResponse.Dispose(); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -2361,7 +2233,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -2369,12 +2241,11 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// Keyspace. + /// + /// The properties required to create or update a Role Assignment. /// /// /// Headers that will be added to request. @@ -2382,46 +2253,80 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// 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 System.Threading.Tasks.Task> BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } - - - - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) - { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListCassandraRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2456,12 +2361,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (keyspaceName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2471,27 +2370,23 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraKeyspaceThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraRoleDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2500,7 +2395,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2529,12 +2424,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2557,16 +2446,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2576,10 +2464,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2592,7 +2476,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2606,7 +2490,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2618,19 +2502,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2643,8 +2514,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Definition with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -2652,8 +2523,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -2676,23 +2547,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2727,12 +2593,11 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (keyspaceName == null) + if (roleDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2742,26 +2607,25 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraKeyspaceToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetCassandraRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2770,7 +2634,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2821,16 +2685,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2840,10 +2703,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2856,7 +2715,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2870,7 +2729,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2882,19 +2741,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2907,8 +2753,60 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// /// The name of the resource group. The name is case insensitive. @@ -2919,6 +2817,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// + /// + /// The parameters to provide for the current Cassandra keyspace. + /// /// /// Headers that will be added to request. /// @@ -2940,23 +2841,26 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateCassandraKeyspaceParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraKeyspaceParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateCassandraKeyspaceParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateCassandraKeyspaceParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2996,7 +2900,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3007,25 +2910,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraKeyspaceToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraKeyspace", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3034,7 +2937,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3063,6 +2966,12 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateCassandraKeyspaceParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraKeyspaceParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -3087,14 +2996,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3104,10 +3012,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3120,7 +3024,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3134,7 +3038,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3148,7 +3052,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3171,7 +3075,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// /// The name of the resource group. The name is case insensitive. @@ -3182,12 +3086,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - /// - /// The parameters to provide for the current Cassandra Table. - /// /// /// Headers that will be added to request. /// @@ -3197,9 +3095,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3209,31 +3104,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateCassandraTableParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraTableParameters"); - } - if (createUpdateCassandraTableParameters != null) - { - createUpdateCassandraTableParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3273,12 +3155,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); } - if (tableName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3289,28 +3165,24 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateCassandraTableParameters", createUpdateCassandraTableParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraKeyspace", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3319,7 +3191,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3348,12 +3220,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateCassandraTableParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraTableParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -3376,16 +3242,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3395,10 +3260,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3411,7 +3272,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3419,27 +3280,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3462,7 +3305,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Create or update an Azure Cosmos DB Cassandra Table /// /// /// The name of the resource group. The name is case insensitive. @@ -3476,6 +3319,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// + /// + /// The parameters to provide for the current Cassandra Table. + /// /// /// Headers that will be added to request. /// @@ -3485,6 +3331,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -3494,23 +3343,26 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateCassandraTableParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraTableParameters"); + } + if (createUpdateCassandraTableParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + createUpdateCassandraTableParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3555,7 +3407,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3567,26 +3418,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3595,7 +3446,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3624,6 +3475,12 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateCassandraTableParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraTableParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -3646,16 +3503,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3665,10 +3521,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3681,7 +3533,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3689,9 +3541,27 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3714,7 +3584,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// /// The name of the resource group. The name is case insensitive. @@ -3728,10 +3598,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// table. - /// /// /// Headers that will be added to request. /// @@ -3741,9 +3607,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3753,31 +3616,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) - { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3822,7 +3672,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3834,27 +3683,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraTableThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3863,7 +3710,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3892,12 +3739,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -3920,16 +3761,15 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3939,10 +3779,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3955,7 +3791,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3963,27 +3799,9 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4006,8 +3824,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// /// The name of the resource group. The name is case insensitive. @@ -4021,6 +3838,10 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// table. + /// /// /// Headers that will be added to request. /// @@ -4042,23 +3863,26 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId != null) + if (updateThroughputParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + updateThroughputParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4103,7 +3927,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4115,26 +3938,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraTableToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraTableThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4143,7 +3966,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4172,6 +3995,12 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -4196,14 +4025,13 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4213,10 +4041,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4229,7 +4053,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4257,7 +4081,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4280,8 +4104,8 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -4316,23 +4140,18 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4377,7 +4196,6 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4389,26 +4207,25 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("keyspaceName", keyspaceName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraTableToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraTableToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4503,7 +4320,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4531,7 +4348,7 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4552,6 +4369,2759 @@ internal CassandraResourcesOperations (CosmosDBManagementClient client) + } + /// + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table 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 System.Threading.Tasks.Task> BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (keyspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + } + + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("keyspaceName", keyspaceName); + tracingParameters.Add("tableName", tableName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraTableToManualThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// Keyspace. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (updateThroughputParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); + } + if (updateThroughputParameters != null) + { + updateThroughputParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (keyspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("keyspaceName", keyspaceName); + + tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateCassandraKeyspaceThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace 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 System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (keyspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("keyspaceName", keyspaceName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraKeyspaceToAutoscale", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace 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 System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (keyspaceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "keyspaceName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("keyspaceName", keyspaceName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateCassandraKeyspaceToManualThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{keyspaceName}", System.Uri.EscapeDataString(keyspaceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateCassandraRoleAssignmentParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraRoleAssignmentParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + tracingParameters.Add("createUpdateCassandraRoleAssignmentParameters", createUpdateCassandraRoleAssignmentParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateCassandraRoleAssignmentParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraRoleAssignmentParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateCassandraRoleDefinitionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateCassandraRoleDefinitionParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + tracingParameters.Add("createUpdateCassandraRoleDefinitionParameters", createUpdateCassandraRoleDefinitionParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateCassandraRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateCassandraRoleDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateCassandraRoleDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteCassandraRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListCassandraKeyspacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraKeyspacesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListCassandraTablesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraTablesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListCassandraRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraRoleAssignmentsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListCassandraRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListCassandraRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperationsExtensions.cs index e63b0b62a400..f7cd96ade4b8 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CassandraResourcesOperationsExtensions.cs @@ -25,7 +25,7 @@ public static partial class CassandraResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListCassandraKeyspaces(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListCassandraKeyspaces(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName) { return ((ICassandraResourcesOperations)operations).ListCassandraKeyspacesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -46,7 +46,7 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListCassandraKeyspacesAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListCassandraKeyspacesAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListCassandraKeyspacesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -191,8 +191,8 @@ public static CassandraResourcesDeleteCassandraKeyspaceHeaders DeleteCassandraKe } } /// - /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -206,14 +206,14 @@ public static CassandraResourcesDeleteCassandraKeyspaceHeaders DeleteCassandraKe /// /// Cosmos DB keyspace name. /// - public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + public static Microsoft.Rest.Azure.IPage ListCassandraTables(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) { - return ((ICassandraResourcesOperations)operations).GetCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).ListCassandraTablesAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -230,15 +230,16 @@ public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this I /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListCassandraTablesAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListCassandraTablesWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Gets the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -252,13 +253,17 @@ public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this I /// /// Cosmos DB keyspace name. /// - public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) + /// + /// Cosmos DB table name. + /// + public static CassandraTableGetResults GetCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) { - return ((ICassandraResourcesOperations)operations).UpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).GetCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Gets the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -272,19 +277,21 @@ public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(thi /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Cassandra Table /// /// /// The operations group for this extension method. @@ -298,14 +305,16 @@ public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(thi /// /// Cosmos DB keyspace name. /// - public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + /// + /// Cosmos DB table name. + /// + public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return ((ICassandraResourcesOperations)operations).MigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).CreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Cassandra Table /// /// /// The operations group for this extension method. @@ -319,19 +328,21 @@ public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToAutoscale(t /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateCassandraKeyspaceToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// /// The operations group for this extension method. @@ -345,14 +356,16 @@ public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToAutoscale(t /// /// Cosmos DB keyspace name. /// - public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + /// + /// Cosmos DB table name. + /// + public static CassandraResourcesDeleteCassandraTableHeaders DeleteCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) { - return ((ICassandraResourcesOperations)operations).MigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).DeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// /// The operations group for this extension method. @@ -366,19 +379,22 @@ public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToManualThrou /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateCassandraKeyspaceToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Lists the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -392,14 +408,17 @@ public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToManualThrou /// /// Cosmos DB keyspace name. /// - public static System.Collections.Generic.IEnumerable ListCassandraTables(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + /// + /// Cosmos DB table name. + /// + public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) { - return ((ICassandraResourcesOperations)operations).ListCassandraTablesAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).GetCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); } /// - /// Lists the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -413,19 +432,21 @@ public static System.Collections.Generic.IEnumerable L /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListCassandraTablesAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetCassandraTableThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListCassandraTablesWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// /// The operations group for this extension method. @@ -442,14 +463,13 @@ public static System.Collections.Generic.IEnumerable L /// /// Cosmos DB table name. /// - public static CassandraTableGetResults GetCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) + public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ICassandraResourcesOperations)operations).GetCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).UpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Gets the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// /// The operations group for this extension method. @@ -469,15 +489,16 @@ public static CassandraTableGetResults GetCassandraTable(this ICassandraResource /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateCassandraTableThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -494,13 +515,14 @@ public static CassandraTableGetResults GetCassandraTable(this ICassandraResource /// /// Cosmos DB table name. /// - public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) + public static ThroughputSettingsGetResults MigrateCassandraTableToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) { - return ((ICassandraResourcesOperations)operations).CreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).MigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -520,15 +542,16 @@ public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandr /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateCassandraTableToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -545,13 +568,14 @@ public static CassandraTableGetResults CreateUpdateCassandraTable(this ICassandr /// /// Cosmos DB table name. /// - public static CassandraResourcesDeleteCassandraTableHeaders DeleteCassandraTable(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) + public static ThroughputSettingsGetResults MigrateCassandraTableToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) { - return ((ICassandraResourcesOperations)operations).DeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).MigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -571,15 +595,15 @@ public static CassandraResourcesDeleteCassandraTableHeaders DeleteCassandraTable /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteCassandraTableAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateCassandraTableToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteCassandraTableWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure /// Cosmos DB database account with the provided name. /// /// @@ -594,16 +618,13 @@ public static CassandraResourcesDeleteCassandraTableHeaders DeleteCassandraTable /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) + public static ThroughputSettingsGetResults GetCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) { - return ((ICassandraResourcesOperations)operations).GetCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).GetCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure /// Cosmos DB database account with the provided name. /// /// @@ -618,21 +639,18 @@ public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICas /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetCassandraTableThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// /// The operations group for this extension method. @@ -646,16 +664,13 @@ public static ThroughputSettingsGetResults GetCassandraTableThroughput(this ICas /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static ThroughputSettingsGetResults UpdateCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ICassandraResourcesOperations)operations).UpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).UpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// /// The operations group for this extension method. @@ -669,21 +684,18 @@ public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this I /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateCassandraTableThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateCassandraTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to /// autoscale /// /// @@ -698,16 +710,13 @@ public static ThroughputSettingsGetResults UpdateCassandraTableThroughput(this I /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - public static ThroughputSettingsGetResults MigrateCassandraTableToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) + public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) { - return ((ICassandraResourcesOperations)operations).MigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).MigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to /// autoscale /// /// @@ -722,21 +731,18 @@ public static ThroughputSettingsGetResults MigrateCassandraTableToAutoscale(this /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateCassandraTableToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateCassandraKeyspaceToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual /// throughput /// /// @@ -751,16 +757,13 @@ public static ThroughputSettingsGetResults MigrateCassandraTableToAutoscale(this /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - public static ThroughputSettingsGetResults MigrateCassandraTableToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName) + public static ThroughputSettingsGetResults MigrateCassandraKeyspaceToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) { - return ((ICassandraResourcesOperations)operations).MigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).MigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual /// throughput /// /// @@ -775,21 +778,18 @@ public static ThroughputSettingsGetResults MigrateCassandraTableToManualThroughp /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateCassandraTableToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateCassandraKeyspaceToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Cassandra keyspace + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. /// /// /// The operations group for this extension method. @@ -800,16 +800,13 @@ public static ThroughputSettingsGetResults MigrateCassandraTableToManualThroughp /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// - public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) + public static Microsoft.Rest.Azure.IPage ListCassandraRoleAssignments(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName) { - return ((ICassandraResourcesOperations)operations).BeginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).ListCassandraRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Cassandra keyspace + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. /// /// /// The operations group for this extension method. @@ -820,21 +817,19 @@ public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(thi /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateCassandraKeyspaceAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListCassandraRoleAssignmentsAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListCassandraRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -845,16 +840,17 @@ public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(thi /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// - public static CassandraResourcesDeleteCassandraKeyspaceHeaders BeginDeleteCassandraKeyspace(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + public static CassandraRoleAssignmentResource GetCassandraRoleAssignment(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ICassandraResourcesOperations)operations).BeginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).GetCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -865,21 +861,21 @@ public static CassandraResourcesDeleteCassandraKeyspaceHeaders BeginDeleteCassan /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteCassandraKeyspaceAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetCassandraRoleAssignmentAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. /// /// /// The operations group for this extension method. @@ -890,16 +886,16 @@ public static CassandraResourcesDeleteCassandraKeyspaceHeaders BeginDeleteCassan /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// - public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static CassandraRoleAssignmentResource CreateUpdateCassandraRoleAssignment(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters) { - return ((ICassandraResourcesOperations)operations).BeginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).CreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. /// /// /// The operations group for this extension method. @@ -910,22 +906,21 @@ public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughpu /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateCassandraRoleAssignmentAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. /// /// /// The operations group for this extension method. @@ -936,17 +931,16 @@ public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughpu /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// - public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + public static CassandraResourcesDeleteCassandraRoleAssignmentHeaders DeleteCassandraRoleAssignment(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ICassandraResourcesOperations)operations).BeginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).DeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. /// /// /// The operations group for this extension method. @@ -957,22 +951,197 @@ public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToAutosc /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateCassandraKeyspaceToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteCassandraRoleAssignmentAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// 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 Microsoft.Rest.Azure.IPage ListCassandraRoleDefinitions(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((ICassandraResourcesOperations)operations).ListCassandraRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// 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 System.Threading.Tasks.Task> ListCassandraRoleDefinitionsAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCassandraRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static CassandraRoleDefinitionResource GetCassandraRoleDefinition(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ICassandraResourcesOperations)operations).GetCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetCassandraRoleDefinitionAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static CassandraRoleDefinitionResource CreateUpdateCassandraRoleDefinition(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters) + { + return ((ICassandraResourcesOperations)operations).CreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateUpdateCassandraRoleDefinitionAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static CassandraResourcesDeleteCassandraRoleDefinitionHeaders DeleteCassandraRoleDefinition(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ICassandraResourcesOperations)operations).DeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteCassandraRoleDefinitionAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// /// The operations group for this extension method. @@ -986,14 +1155,13 @@ public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToAutosc /// /// Cosmos DB keyspace name. /// - public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + public static CassandraKeyspaceGetResults BeginCreateUpdateCassandraKeyspace(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return ((ICassandraResourcesOperations)operations).BeginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + return ((ICassandraResourcesOperations)operations).BeginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// /// The operations group for this extension method. @@ -1010,14 +1178,59 @@ public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToManual /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateCassandraKeyspaceToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateCassandraKeyspaceAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// + /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + public static CassandraResourcesDeleteCassandraKeyspaceHeaders BeginDeleteCassandraKeyspace(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + { + return ((ICassandraResourcesOperations)operations).BeginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteCassandraKeyspaceAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// /// Create or update an Azure Cosmos DB Cassandra Table /// /// @@ -1276,5 +1489,460 @@ public static ThroughputSettingsGetResults BeginMigrateCassandraTableToManualThr return _result.Body; } } + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + public static ThroughputSettingsGetResults BeginUpdateCassandraKeyspaceThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) + { + return ((ICassandraResourcesOperations)operations).BeginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters).GetAwaiter().GetResult(); + } + + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateCassandraKeyspaceThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + /// autoscale + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToAutoscale(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + { + return ((ICassandraResourcesOperations)operations).BeginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + } + + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + /// autoscale + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMigrateCassandraKeyspaceToAutoscaleAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + /// throughput + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + public static ThroughputSettingsGetResults BeginMigrateCassandraKeyspaceToManualThroughput(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName) + { + return ((ICassandraResourcesOperations)operations).BeginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).GetAwaiter().GetResult(); + } + + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + /// throughput + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMigrateCassandraKeyspaceToManualThroughputAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string keyspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, keyspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static CassandraRoleAssignmentResource BeginCreateUpdateCassandraRoleAssignment(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters) + { + return ((ICassandraResourcesOperations)operations).BeginCreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateCassandraRoleAssignmentAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static CassandraResourcesDeleteCassandraRoleAssignmentHeaders BeginDeleteCassandraRoleAssignment(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((ICassandraResourcesOperations)operations).BeginDeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteCassandraRoleAssignmentAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteCassandraRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static CassandraRoleDefinitionResource BeginCreateUpdateCassandraRoleDefinition(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters) + { + return ((ICassandraResourcesOperations)operations).BeginCreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateCassandraRoleDefinitionAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static CassandraResourcesDeleteCassandraRoleDefinitionHeaders BeginDeleteCassandraRoleDefinition(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ICassandraResourcesOperations)operations).BeginDeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteCassandraRoleDefinitionAsync(this ICassandraResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteCassandraRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCassandraKeyspacesNext(this ICassandraResourcesOperations operations, string nextPageLink) + { + return ((ICassandraResourcesOperations)operations).ListCassandraKeyspacesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCassandraKeyspacesNextAsync(this ICassandraResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCassandraKeyspacesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCassandraTablesNext(this ICassandraResourcesOperations operations, string nextPageLink) + { + return ((ICassandraResourcesOperations)operations).ListCassandraTablesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCassandraTablesNextAsync(this ICassandraResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCassandraTablesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCassandraRoleAssignmentsNext(this ICassandraResourcesOperations operations, string nextPageLink) + { + return ((ICassandraResourcesOperations)operations).ListCassandraRoleAssignmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCassandraRoleAssignmentsNextAsync(this ICassandraResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCassandraRoleAssignmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListCassandraRoleDefinitionsNext(this ICassandraResourcesOperations operations, string nextPageLink) + { + return ((ICassandraResourcesOperations)operations).ListCassandraRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListCassandraRoleDefinitionsNextAsync(this ICassandraResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListCassandraRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperations.cs index 2172a4e3565f..62c09660e305 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperations.cs @@ -39,8 +39,7 @@ internal CollectionOperations (CosmosDBManagementClient client) public CosmosDBManagementClient Client { get; private set; } /// - /// Retrieves the metrics determined by the given filter for the given database - /// account and collection. + /// Retrieves metric definitions for the given collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -54,12 +53,6 @@ internal CollectionOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection rid. /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. - /// /// /// Headers that will be added to request. /// @@ -81,23 +74,18 @@ internal CollectionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -142,12 +130,6 @@ internal CollectionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionRid"); } - if (filter == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -159,31 +141,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (filter != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -245,14 +221,13 @@ internal CollectionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -262,10 +237,6 @@ internal CollectionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -278,7 +249,7 @@ internal CollectionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -292,7 +263,7 @@ internal CollectionOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -316,7 +287,8 @@ internal CollectionOperations (CosmosDBManagementClient client) } /// - /// Retrieves the usages (most recent storage data) for the given collection. + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -331,9 +303,10 @@ internal CollectionOperations (CosmosDBManagementClient client) /// Cosmos DB collection rid. /// /// - /// An OData filter expression that describes a subset of usages to return. The - /// supported parameter is name.value (name of the metric, can have an or of - /// multiple names). + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. /// /// /// Headers that will be added to request. @@ -356,23 +329,18 @@ internal CollectionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -417,8 +385,11 @@ internal CollectionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionRid"); } + if (filter == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); + } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -430,27 +401,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -516,14 +486,13 @@ internal CollectionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -533,10 +502,6 @@ internal CollectionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -549,7 +514,7 @@ internal CollectionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -563,7 +528,7 @@ internal CollectionOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -587,7 +552,7 @@ internal CollectionOperations (CosmosDBManagementClient client) } /// - /// Retrieves metric definitions for the given collection. + /// Retrieves the usages (most recent storage data) for the given collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -601,6 +566,11 @@ internal CollectionOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection rid. /// + /// + /// An OData filter expression that describes a subset of usages to return. The + /// supported parameter is name.value (name of the metric, can have an or of + /// multiple names). + /// /// /// Headers that will be added to request. /// @@ -622,23 +592,18 @@ internal CollectionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -683,7 +648,7 @@ internal CollectionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionRid"); } - string apiVersion = "2025-10-15"; + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -695,26 +660,30 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -776,14 +745,13 @@ internal CollectionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -793,10 +761,183 @@ internal CollectionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + // Ignore the exception } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -809,7 +950,7 @@ internal CollectionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -845,6 +986,361 @@ internal CollectionOperations (CosmosDBManagementClient client) + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the usages (most recent storage data) for the given collection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsagesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperationsExtensions.cs index 7b8c17ebae87..731cd9a27ced 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionOperationsExtensions.cs @@ -12,6 +12,57 @@ namespace Microsoft.Azure.Management.CosmosDB /// public static partial class CollectionOperationsExtensions { + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + /// + /// Cosmos DB collection rid. + /// + public static Microsoft.Rest.Azure.IPage ListMetricDefinitions(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid) + { + return ((ICollectionOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, collectionRid).GetAwaiter().GetResult(); + } + + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + /// + /// Cosmos DB collection rid. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Retrieves the metrics determined by the given filter for the given database /// account and collection. @@ -37,7 +88,7 @@ public static partial class CollectionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter) { return ((ICollectionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -70,7 +121,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this IC /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -100,7 +151,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this IC /// supported parameter is name.value (name of the metric, can have an or of /// multiple names). /// - public static System.Collections.Generic.IEnumerable ListUsages(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string)) + public static Microsoft.Rest.Azure.IPage ListUsages(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string)) { return ((ICollectionOperations)operations).ListUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -131,7 +182,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this IC /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsagesAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -144,47 +195,97 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this IC /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + public static Microsoft.Rest.Azure.IPage ListMetricDefinitionsNext(this ICollectionOperations operations, string nextPageLink) + { + return ((ICollectionOperations)operations).ListMetricDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// The operations group for this extension method. /// - /// - /// Cosmos DB database rid. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB collection rid. + /// + /// The cancellation token. /// - public static System.Collections.Generic.IEnumerable ListMetricDefinitions(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid) + public static async System.Threading.Tasks.Task> ListMetricDefinitionsNextAsync(this ICollectionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - return ((ICollectionOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, collectionRid).GetAwaiter().GetResult(); + using (var _result = await operations.ListMetricDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this ICollectionOperations operations, string nextPageLink) + { + return ((ICollectionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves metric definitions for the given collection. + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The cancellation token. /// - /// - /// Cosmos DB database rid. + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this ICollectionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the usages (most recent storage data) for the given collection. + /// + /// + /// The operations group for this extension method. /// - /// - /// Cosmos DB collection rid. + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListUsagesNext(this ICollectionOperations operations, string nextPageLink) + { + return ((ICollectionOperations)operations).ListUsagesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the usages (most recent storage data) for the given collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesNextAsync(this ICollectionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListUsagesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperations.cs index ab4e8e855044..2c64dc51cb49 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperations.cs @@ -81,23 +81,18 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -147,7 +142,6 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -159,7 +153,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); @@ -170,16 +163,16 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -245,14 +238,13 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -262,10 +254,6 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -278,7 +266,7 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -357,23 +345,18 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -419,7 +402,6 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -431,7 +413,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); @@ -442,16 +423,16 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -517,14 +498,191 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection, split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -534,10 +692,184 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the usages (most recent storage data) for the given collection, + /// split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsagesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -550,7 +882,7 @@ internal CollectionPartitionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperationsExtensions.cs index 26c1fa73cd50..22376bf1fdf5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionOperationsExtensions.cs @@ -37,7 +37,7 @@ public static partial class CollectionPartitionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter) { return ((ICollectionPartitionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -70,7 +70,7 @@ public static System.Collections.Generic.IEnumerable ListMetric /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -101,7 +101,7 @@ public static System.Collections.Generic.IEnumerable ListMetric /// supported parameter is name.value (name of the metric, can have an or of /// multiple names). /// - public static System.Collections.Generic.IEnumerable ListUsages(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string)) + public static Microsoft.Rest.Azure.IPage ListUsages(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string)) { return ((ICollectionPartitionOperations)operations).ListUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -133,12 +133,82 @@ public static System.Collections.Generic.IEnumerable ListMetric /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsagesAsync(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesAsync(this ICollectionPartitionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection, split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this ICollectionPartitionOperations operations, string nextPageLink) + { + return ((ICollectionPartitionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection, split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this ICollectionPartitionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the usages (most recent storage data) for the given collection, + /// split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListUsagesNext(this ICollectionPartitionOperations operations, string nextPageLink) + { + return ((ICollectionPartitionOperations)operations).ListUsagesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the usages (most recent storage data) for the given collection, + /// split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListUsagesNextAsync(this ICollectionPartitionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListUsagesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperations.cs index 2ac5fe7fc594..bf18188c936d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperations.cs @@ -84,23 +84,18 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -155,7 +150,6 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -168,7 +162,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); @@ -179,7 +172,7 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{region}", System.Uri.EscapeDataString(region)); @@ -187,9 +180,9 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -255,14 +248,13 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -272,10 +264,184 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection and region, split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -288,7 +454,7 @@ internal CollectionPartitionRegionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperationsExtensions.cs index 8892ffc18fc7..60cc8af147fd 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionPartitionRegionOperationsExtensions.cs @@ -40,7 +40,7 @@ public static partial class CollectionPartitionRegionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this ICollectionPartitionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this ICollectionPartitionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter) { return ((ICollectionPartitionRegionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -76,12 +76,47 @@ public static System.Collections.Generic.IEnumerable ListMetric /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionPartitionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionPartitionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection and region, split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this ICollectionPartitionRegionOperations operations, string nextPageLink) + { + return ((ICollectionPartitionRegionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection and region, split by partition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this ICollectionPartitionRegionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperations.cs index e8637e9fbdb3..6d627d36aac5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperations.cs @@ -84,23 +84,18 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -155,7 +150,6 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -168,7 +162,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); @@ -179,7 +172,7 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{region}", System.Uri.EscapeDataString(region)); @@ -187,9 +180,9 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) _url = _url.Replace("{collectionRid}", System.Uri.EscapeDataString(collectionRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -255,14 +248,13 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -272,10 +264,184 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account, collection and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -288,7 +454,7 @@ internal CollectionRegionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperationsExtensions.cs index d9baa39f5776..ab2a2120802e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CollectionRegionOperationsExtensions.cs @@ -40,7 +40,7 @@ public static partial class CollectionRegionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this ICollectionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this ICollectionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter) { return ((ICollectionRegionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); } @@ -76,12 +76,47 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this IC /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this ICollectionRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account, collection and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this ICollectionRegionOperations operations, string nextPageLink) + { + return ((ICollectionRegionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account, collection and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this ICollectionRegionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CosmosDBManagementClient.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CosmosDBManagementClient.cs index 8a31387fdac4..2e37001b068a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CosmosDBManagementClient.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/CosmosDBManagementClient.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB using Models; /// - /// Azure Cosmos DB Database Service Resource Provider REST API + /// Azure Cosmos DB Throughput Pool REST API /// public partial class CosmosDBManagementClient : Microsoft.Rest.ServiceClient, ICosmosDBManagementClient, IAzureClient { @@ -33,9 +33,14 @@ public partial class CosmosDBManagementClient : Microsoft.Rest.ServiceClient - /// The ID of the target subscription. + /// The API version to use for this operation. /// - public string SubscriptionId { get; set;} + public string ApiVersion { get; private set; } + + /// + /// The ID of the target subscription. The value must be an UUID. + /// + public System.Guid SubscriptionId { get; set;} /// /// The preferred language for the response. @@ -64,149 +69,153 @@ public partial class CosmosDBManagementClient : Microsoft.Rest.ServiceClient public virtual IOperations Operations { get; private set; } /// - /// Gets the IDatabaseOperations + /// Gets the ICassandraClustersOperations /// - public virtual IDatabaseOperations Database { get; private set; } + public virtual ICassandraClustersOperations CassandraClusters { get; private set; } /// - /// Gets the ICollectionOperations + /// Gets the IFleetOperations /// - public virtual ICollectionOperations Collection { get; private set; } + public virtual IFleetOperations Fleet { get; private set; } /// - /// Gets the ICollectionRegionOperations + /// Gets the ILocationsOperations /// - public virtual ICollectionRegionOperations CollectionRegion { get; private set; } + public virtual ILocationsOperations Locations { get; private set; } /// - /// Gets the IDatabaseAccountRegionOperations + /// Gets the IRestorableDatabaseAccountsOperations /// - public virtual IDatabaseAccountRegionOperations DatabaseAccountRegion { get; private set; } + public virtual IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; private set; } /// - /// Gets the IPercentileSourceTargetOperations + /// Gets the IRestorableGremlinGraphsOperations /// - public virtual IPercentileSourceTargetOperations PercentileSourceTarget { get; private set; } + public virtual IRestorableGremlinGraphsOperations RestorableGremlinGraphs { get; private set; } /// - /// Gets the IPercentileTargetOperations + /// Gets the IRestorableGremlinDatabasesOperations /// - public virtual IPercentileTargetOperations PercentileTarget { get; private set; } + public virtual IRestorableGremlinDatabasesOperations RestorableGremlinDatabases { get; private set; } /// - /// Gets the IPercentileOperations + /// Gets the IRestorableGremlinResourcesOperations /// - public virtual IPercentileOperations Percentile { get; private set; } + public virtual IRestorableGremlinResourcesOperations RestorableGremlinResources { get; private set; } /// - /// Gets the ICollectionPartitionRegionOperations + /// Gets the IRestorableMongodbCollectionsOperations /// - public virtual ICollectionPartitionRegionOperations CollectionPartitionRegion { get; private set; } + public virtual IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; private set; } /// - /// Gets the ICollectionPartitionOperations + /// Gets the IRestorableMongodbDatabasesOperations /// - public virtual ICollectionPartitionOperations CollectionPartition { get; private set; } + public virtual IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; private set; } /// - /// Gets the IPartitionKeyRangeIdOperations + /// Gets the IRestorableMongodbResourcesOperations /// - public virtual IPartitionKeyRangeIdOperations PartitionKeyRangeId { get; private set; } + public virtual IRestorableMongodbResourcesOperations RestorableMongodbResources { get; private set; } /// - /// Gets the IPartitionKeyRangeIdRegionOperations + /// Gets the IRestorableSqlContainersOperations /// - public virtual IPartitionKeyRangeIdRegionOperations PartitionKeyRangeIdRegion { get; private set; } + public virtual IRestorableSqlContainersOperations RestorableSqlContainers { get; private set; } /// - /// Gets the ISqlResourcesOperations + /// Gets the IRestorableSqlDatabasesOperations /// - public virtual ISqlResourcesOperations SqlResources { get; private set; } + public virtual IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; private set; } /// - /// Gets the IMongoDbResourcesOperations + /// Gets the IRestorableSqlResourcesOperations /// - public virtual IMongoDbResourcesOperations MongoDbResources { get; private set; } + public virtual IRestorableSqlResourcesOperations RestorableSqlResources { get; private set; } /// - /// Gets the ITableResourcesOperations + /// Gets the IRestorableTableResourcesOperations /// - public virtual ITableResourcesOperations TableResources { get; private set; } + public virtual IRestorableTableResourcesOperations RestorableTableResources { get; private set; } /// - /// Gets the ICassandraResourcesOperations + /// Gets the IRestorableTablesOperations /// - public virtual ICassandraResourcesOperations CassandraResources { get; private set; } + public virtual IRestorableTablesOperations RestorableTables { get; private set; } /// - /// Gets the IGremlinResourcesOperations + /// Gets the ICassandraDataCentersOperations /// - public virtual IGremlinResourcesOperations GremlinResources { get; private set; } + public virtual ICassandraDataCentersOperations CassandraDataCenters { get; private set; } /// - /// Gets the ILocationsOperations + /// Gets the ICassandraResourcesOperations /// - public virtual ILocationsOperations Locations { get; private set; } + public virtual ICassandraResourcesOperations CassandraResources { get; private set; } /// - /// Gets the ICassandraClustersOperations + /// Gets the ICollectionOperations /// - public virtual ICassandraClustersOperations CassandraClusters { get; private set; } + public virtual ICollectionOperations Collection { get; private set; } /// - /// Gets the ICassandraDataCentersOperations + /// Gets the IPartitionKeyRangeIdOperations /// - public virtual ICassandraDataCentersOperations CassandraDataCenters { get; private set; } + public virtual IPartitionKeyRangeIdOperations PartitionKeyRangeId { get; private set; } /// - /// Gets the INotebookWorkspacesOperations + /// Gets the ICollectionPartitionOperations /// - public virtual INotebookWorkspacesOperations NotebookWorkspaces { get; private set; } + public virtual ICollectionPartitionOperations CollectionPartition { get; private set; } /// - /// Gets the IPrivateEndpointConnectionsOperations + /// Gets the IDatabaseOperations /// - public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } + public virtual IDatabaseOperations Database { get; private set; } /// - /// Gets the IPrivateLinkResourcesOperations + /// Gets the IGremlinResourcesOperations /// - public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } + public virtual IGremlinResourcesOperations GremlinResources { get; private set; } /// - /// Gets the IRestorableDatabaseAccountsOperations + /// Gets the IMongoMiResourcesOperations /// - public virtual IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; private set; } + public virtual IMongoMiResourcesOperations MongoMiResources { get; private set; } /// - /// Gets the IRestorableSqlDatabasesOperations + /// Gets the IMongoDbResourcesOperations /// - public virtual IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; private set; } + public virtual IMongoDbResourcesOperations MongoDbResources { get; private set; } /// - /// Gets the IRestorableSqlContainersOperations + /// Gets the INotebookWorkspacesOperations /// - public virtual IRestorableSqlContainersOperations RestorableSqlContainers { get; private set; } + public virtual INotebookWorkspacesOperations NotebookWorkspaces { get; private set; } /// - /// Gets the IRestorableSqlResourcesOperations + /// Gets the IPercentileOperations /// - public virtual IRestorableSqlResourcesOperations RestorableSqlResources { get; private set; } + public virtual IPercentileOperations Percentile { get; private set; } /// - /// Gets the IRestorableMongodbDatabasesOperations + /// Gets the IPrivateEndpointConnectionsOperations /// - public virtual IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; private set; } + public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; } /// - /// Gets the IRestorableMongodbCollectionsOperations + /// Gets the IPrivateLinkResourcesOperations /// - public virtual IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; private set; } + public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; } /// - /// Gets the IRestorableMongodbResourcesOperations + /// Gets the ICollectionRegionOperations /// - public virtual IRestorableMongodbResourcesOperations RestorableMongodbResources { get; private set; } + public virtual ICollectionRegionOperations CollectionRegion { get; private set; } /// - /// Gets the IRestorableGremlinDatabasesOperations + /// Gets the IPartitionKeyRangeIdRegionOperations /// - public virtual IRestorableGremlinDatabasesOperations RestorableGremlinDatabases { get; private set; } + public virtual IPartitionKeyRangeIdRegionOperations PartitionKeyRangeIdRegion { get; private set; } /// - /// Gets the IRestorableGremlinGraphsOperations + /// Gets the ICollectionPartitionRegionOperations /// - public virtual IRestorableGremlinGraphsOperations RestorableGremlinGraphs { get; private set; } + public virtual ICollectionPartitionRegionOperations CollectionPartitionRegion { get; private set; } /// - /// Gets the IRestorableGremlinResourcesOperations + /// Gets the IDatabaseAccountRegionOperations /// - public virtual IRestorableGremlinResourcesOperations RestorableGremlinResources { get; private set; } + public virtual IDatabaseAccountRegionOperations DatabaseAccountRegion { get; private set; } /// - /// Gets the IRestorableTablesOperations + /// Gets the IServiceOperations /// - public virtual IRestorableTablesOperations RestorableTables { get; private set; } + public virtual IServiceOperations Service { get; private set; } /// - /// Gets the IRestorableTableResourcesOperations + /// Gets the IPercentileSourceTargetOperations /// - public virtual IRestorableTableResourcesOperations RestorableTableResources { get; private set; } + public virtual IPercentileSourceTargetOperations PercentileSourceTarget { get; private set; } /// - /// Gets the IServiceOperations + /// Gets the ISqlResourcesOperations /// - public virtual IServiceOperations Service { get; private set; } + public virtual ISqlResourcesOperations SqlResources { get; private set; } /// - /// Gets the IFleetOperations + /// Gets the ITableResourcesOperations /// - public virtual IFleetOperations Fleet { get; private set; } + public virtual ITableResourcesOperations TableResources { get; private set; } + /// + /// Gets the IPercentileTargetOperations + /// + public virtual IPercentileTargetOperations PercentileTarget { get; private set; } /// /// Gets the IFleetspaceOperations /// @@ -455,45 +464,47 @@ private void Initialize() { this.DatabaseAccounts = new DatabaseAccountsOperations(this); this.Operations = new Operations(this); - this.Database = new DatabaseOperations(this); + this.CassandraClusters = new CassandraClustersOperations(this); + this.Fleet = new FleetOperations(this); + this.Locations = new LocationsOperations(this); + this.RestorableDatabaseAccounts = new RestorableDatabaseAccountsOperations(this); + this.RestorableGremlinGraphs = new RestorableGremlinGraphsOperations(this); + this.RestorableGremlinDatabases = new RestorableGremlinDatabasesOperations(this); + this.RestorableGremlinResources = new RestorableGremlinResourcesOperations(this); + this.RestorableMongodbCollections = new RestorableMongodbCollectionsOperations(this); + this.RestorableMongodbDatabases = new RestorableMongodbDatabasesOperations(this); + this.RestorableMongodbResources = new RestorableMongodbResourcesOperations(this); + this.RestorableSqlContainers = new RestorableSqlContainersOperations(this); + this.RestorableSqlDatabases = new RestorableSqlDatabasesOperations(this); + this.RestorableSqlResources = new RestorableSqlResourcesOperations(this); + this.RestorableTableResources = new RestorableTableResourcesOperations(this); + this.RestorableTables = new RestorableTablesOperations(this); + this.CassandraDataCenters = new CassandraDataCentersOperations(this); + this.CassandraResources = new CassandraResourcesOperations(this); this.Collection = new CollectionOperations(this); - this.CollectionRegion = new CollectionRegionOperations(this); - this.DatabaseAccountRegion = new DatabaseAccountRegionOperations(this); - this.PercentileSourceTarget = new PercentileSourceTargetOperations(this); - this.PercentileTarget = new PercentileTargetOperations(this); - this.Percentile = new PercentileOperations(this); - this.CollectionPartitionRegion = new CollectionPartitionRegionOperations(this); - this.CollectionPartition = new CollectionPartitionOperations(this); this.PartitionKeyRangeId = new PartitionKeyRangeIdOperations(this); - this.PartitionKeyRangeIdRegion = new PartitionKeyRangeIdRegionOperations(this); - this.SqlResources = new SqlResourcesOperations(this); - this.MongoDbResources = new MongoDbResourcesOperations(this); - this.TableResources = new TableResourcesOperations(this); - this.CassandraResources = new CassandraResourcesOperations(this); + this.CollectionPartition = new CollectionPartitionOperations(this); + this.Database = new DatabaseOperations(this); this.GremlinResources = new GremlinResourcesOperations(this); - this.Locations = new LocationsOperations(this); - this.CassandraClusters = new CassandraClustersOperations(this); - this.CassandraDataCenters = new CassandraDataCentersOperations(this); + this.MongoMiResources = new MongoMiResourcesOperations(this); + this.MongoDbResources = new MongoDbResourcesOperations(this); this.NotebookWorkspaces = new NotebookWorkspacesOperations(this); + this.Percentile = new PercentileOperations(this); this.PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); this.PrivateLinkResources = new PrivateLinkResourcesOperations(this); - this.RestorableDatabaseAccounts = new RestorableDatabaseAccountsOperations(this); - this.RestorableSqlDatabases = new RestorableSqlDatabasesOperations(this); - this.RestorableSqlContainers = new RestorableSqlContainersOperations(this); - this.RestorableSqlResources = new RestorableSqlResourcesOperations(this); - this.RestorableMongodbDatabases = new RestorableMongodbDatabasesOperations(this); - this.RestorableMongodbCollections = new RestorableMongodbCollectionsOperations(this); - this.RestorableMongodbResources = new RestorableMongodbResourcesOperations(this); - this.RestorableGremlinDatabases = new RestorableGremlinDatabasesOperations(this); - this.RestorableGremlinGraphs = new RestorableGremlinGraphsOperations(this); - this.RestorableGremlinResources = new RestorableGremlinResourcesOperations(this); - this.RestorableTables = new RestorableTablesOperations(this); - this.RestorableTableResources = new RestorableTableResourcesOperations(this); + this.CollectionRegion = new CollectionRegionOperations(this); + this.PartitionKeyRangeIdRegion = new PartitionKeyRangeIdRegionOperations(this); + this.CollectionPartitionRegion = new CollectionPartitionRegionOperations(this); + this.DatabaseAccountRegion = new DatabaseAccountRegionOperations(this); this.Service = new ServiceOperations(this); - this.Fleet = new FleetOperations(this); + this.PercentileSourceTarget = new PercentileSourceTargetOperations(this); + this.SqlResources = new SqlResourcesOperations(this); + this.TableResources = new TableResourcesOperations(this); + this.PercentileTarget = new PercentileTargetOperations(this); this.Fleetspace = new FleetspaceOperations(this); this.FleetspaceAccount = new FleetspaceAccountOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); + this.ApiVersion = "2026-03-15"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperations.cs index 9b8d5d5d4d45..325a63fefe13 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperations.cs @@ -78,23 +78,18 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -139,7 +134,6 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -150,7 +144,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); @@ -161,15 +154,15 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{region}", System.Uri.EscapeDataString(region)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -235,14 +228,13 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -252,10 +244,184 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -268,7 +434,7 @@ internal DatabaseAccountRegionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperationsExtensions.cs index 65e50d6d071d..3912fa0c8074 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountRegionOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class DatabaseAccountRegionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IDatabaseAccountRegionOperations operations, string resourceGroupName, string accountName, string region, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IDatabaseAccountRegionOperations operations, string resourceGroupName, string accountName, string region, string filter) { return ((IDatabaseAccountRegionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, region, filter).GetAwaiter().GetResult(); } @@ -64,12 +64,47 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseAccountRegionOperations operations, string resourceGroupName, string accountName, string region, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseAccountRegionOperations operations, string resourceGroupName, string accountName, string region, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, region, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IDatabaseAccountRegionOperations operations, string nextPageLink) + { + return ((IDatabaseAccountRegionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IDatabaseAccountRegionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperations.cs index 164131abbf59..51b6af6726e9 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperations.cs @@ -39,11 +39,10 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) public CosmosDBManagementClient Client { get; private set; } /// - /// Retrieves the properties of an existing Azure Cosmos DB database account. + /// Checks that the Azure Cosmos DB account name already exists. A valid + /// account name may contain only lowercase letters, numbers, and the '-' + /// character, and must be between 3 and 50 characters. /// - /// - /// The name of the resource group. The name is case insensitive. - /// /// /// Cosmos DB database account name. /// @@ -56,9 +55,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -68,38 +64,17 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CheckNameExistsWithHttpMessagesAsync(string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) + if (this.Client.ApiVersion == null) { - if (resourceGroupName.Length > 90) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); @@ -119,7 +94,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -127,26 +101,22 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameExists", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -155,7 +125,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -196,7 +166,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -206,16 +176,15 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +194,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -241,32 +206,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; - + _result.Body = (_statusCode == System.Net.HttpStatusCode.OK); 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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -278,108 +225,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } - /// - /// Updates the properties of an existing Azure Cosmos DB database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The parameters to provide for the current database account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, updateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The parameters to provide for the current database account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB database 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. - /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Changes the failover priority for the Azure Cosmos DB database account. A - /// failover priority of 0 indicates a write region. The maximum value for a - /// failover priority = (total number of regions - 1). Failover priority values - /// must be unique for each of the regions in which the database account - /// exists. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The new failover policies for the database account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> FailoverPriorityChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, FailoverPolicies failoverParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginFailoverPriorityChangeWithHttpMessagesAsync(resourceGroupName, accountName, failoverParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Lists all the Azure Cosmos DB database accounts available under the /// subscription. @@ -405,24 +250,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2025-10-15"; + + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -430,7 +269,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -440,12 +278,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; 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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -507,14 +345,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -524,10 +361,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -540,7 +373,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -605,12 +438,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -626,18 +465,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -646,7 +473,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -656,13 +482,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -724,14 +550,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -741,10 +566,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -757,7 +578,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -795,7 +616,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Lists the access keys for the specified Azure Cosmos DB database account. + /// Retrieves the properties of an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -824,23 +645,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -875,7 +691,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -885,24 +700,23 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -911,7 +725,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -964,14 +778,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -981,10 +794,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -997,7 +806,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1011,7 +820,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1035,8 +844,8 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Lists the connection strings for the specified Azure Cosmos DB database - /// account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1044,49 +853,146 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// + /// + /// The parameters to provide for the current database account. + /// /// /// 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 System.Threading.Tasks.Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } - - - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) + /// + /// Updates the properties of an existing Azure Cosmos DB database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The parameters to provide for the current database account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, updateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB database 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. + /// + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Changes the failover priority for the Azure Cosmos DB database account. A + /// failover priority of 0 indicates a write region. The maximum value for a + /// failover priority = (total number of regions - 1). Failover priority values + /// must be unique for each of the regions in which the database account + /// exists. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The new failover policies for the database account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> FailoverPriorityChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, FailoverPolicies failoverParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginFailoverPriorityChangeWithHttpMessagesAsync(resourceGroupName, accountName, failoverParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the connection strings for the specified Azure Cosmos DB database + /// 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 System.Threading.Tasks.Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) { if (resourceGroupName.Length > 90) { @@ -1116,7 +1022,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1126,7 +1031,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1136,14 +1040,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1205,14 +1109,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1222,10 +1125,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1276,60 +1175,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Offline the specified region for the specified Azure Cosmos DB database - /// account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB region to offline for the database account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> OfflineRegionWithHttpMessagesAsync(string resourceGroupName, string accountName, RegionForOnlineOffline regionParameterForOffline, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginOfflineRegionWithHttpMessagesAsync(resourceGroupName, accountName, regionParameterForOffline, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Online the specified region for the specified Azure Cosmos DB database - /// account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB region to online for the database account. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> OnlineRegionWithHttpMessagesAsync(string resourceGroupName, string accountName, RegionForOnlineOffline regionParameterForOnline, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginOnlineRegionWithHttpMessagesAsync(resourceGroupName, accountName, regionParameterForOnline, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the read-only access keys for the specified Azure Cosmos DB database - /// account. + /// Lists the access keys for the specified Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1358,23 +1204,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetReadOnlyKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1409,7 +1250,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1419,24 +1259,23 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetReadOnlyKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1445,7 +1284,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1498,14 +1337,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1515,10 +1353,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1531,7 +1365,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1545,7 +1379,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1569,8 +1403,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Lists the read-only access keys for the specified Azure Cosmos DB database - /// account. + /// Retrieves metric definitions for the given database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1599,23 +1432,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> ListReadOnlyKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1650,7 +1478,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1660,24 +1487,23 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListReadOnlyKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1686,7 +1512,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1739,14 +1565,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1756,10 +1581,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1772,7 +1593,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1786,7 +1607,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1810,7 +1631,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Regenerates an access key for the specified Azure Cosmos DB database + /// Retrieves the metrics determined by the given filter for the given database /// account. /// /// @@ -1819,29 +1640,11 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The name of the key to regenerate. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountRegenerateKeyParameters keyToRegenerate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRegenerateKeyWithHttpMessagesAsync(resourceGroupName, accountName, keyToRegenerate, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Checks that the Azure Cosmos DB account name already exists. A valid - /// account name may contain only lowercase letters, numbers, and the '-' - /// character, and must be between 3 and 50 characters. - /// - /// - /// Cosmos DB database account name. + /// + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. /// /// /// Headers that will be added to request. @@ -1852,8 +1655,11 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null /// /// /// Thrown when a required parameter is null @@ -1861,12 +1667,33 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CheckNameExistsWithHttpMessagesAsync(string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (accountName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); @@ -1886,7 +1713,11 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (filter == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1894,23 +1725,30 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CheckNameExists", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (filter != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -1919,7 +1757,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("HEAD"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1960,7 +1798,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); @@ -1970,16 +1808,15 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1989,10 +1826,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2005,14 +1838,32 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; - _result.Body = (_statusCode == System.Net.HttpStatusCode.OK); + 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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2025,7 +1876,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Retrieves the metrics determined by the given filter for the given database + /// Offline the specified region for the specified Azure Cosmos DB database /// account. /// /// @@ -2034,11 +1885,57 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. + /// + /// Cosmos DB region to offline for the database account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> OfflineRegionWithHttpMessagesAsync(string resourceGroupName, string accountName, RegionForOnlineOffline regionParameterForOffline, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginOfflineRegionWithHttpMessagesAsync(resourceGroupName, accountName, regionParameterForOffline, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Online the specified region for the specified Azure Cosmos DB database + /// account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB region to online for the database account. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> OnlineRegionWithHttpMessagesAsync(string resourceGroupName, string accountName, RegionForOnlineOffline regionParameterForOnline, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginOnlineRegionWithHttpMessagesAsync(resourceGroupName, accountName, regionParameterForOnline, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the read-only access keys for the specified Azure Cosmos DB database + /// account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. /// /// /// Headers that will be added to request. @@ -2061,23 +1958,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetReadOnlyKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2112,12 +2004,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (filter == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2127,29 +2013,23 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetReadOnlyKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (filter != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2211,14 +2091,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2228,10 +2107,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2244,7 +2119,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2258,7 +2133,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2282,7 +2157,8 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Retrieves the usages (most recent data) for the given database account. + /// Lists the read-only access keys for the specified Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2290,11 +2166,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// An OData filter expression that describes a subset of usages to return. The - /// supported parameter is name.value (name of the metric, can have an or of - /// multiple names). - /// /// /// Headers that will be added to request. /// @@ -2316,23 +2187,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> ListReadOnlyKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2367,8 +2233,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2378,29 +2242,23 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListReadOnlyKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (filter != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2409,7 +2267,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2462,14 +2320,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2479,10 +2336,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2495,7 +2348,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2509,7 +2362,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2533,7 +2386,33 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Retrieves metric definitions for the given database account. + /// Regenerates an access key for the specified Azure Cosmos DB database + /// account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The name of the key to regenerate. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountRegenerateKeyParameters keyToRegenerate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRegenerateKeyWithHttpMessagesAsync(resourceGroupName, accountName, keyToRegenerate, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the usages (most recent data) for the given database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2541,6 +2420,11 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// + /// + /// An OData filter expression that describes a subset of usages to return. The + /// supported parameter is name.value (name of the metric, can have an or of + /// multiple names). + /// /// /// Headers that will be added to request. /// @@ -2562,23 +2446,18 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2613,7 +2492,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2623,24 +2502,28 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (filter != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -2702,14 +2585,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2719,10 +2601,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2735,7 +2613,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2749,7 +2627,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2773,7 +2651,8 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Updates the properties of an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2781,7 +2660,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// + /// /// The parameters to provide for the current database account. /// /// @@ -2805,27 +2684,26 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateParameters == null) + if (createUpdateParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateParameters"); } - if (this.Client.SubscriptionId == null) + if (createUpdateParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + createUpdateParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2860,7 +2738,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2870,25 +2747,24 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("updateParameters", updateParameters); + tracingParameters.Add("createUpdateParameters", createUpdateParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2897,7 +2773,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2926,9 +2802,9 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateParameters != null) + if(createUpdateParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -2956,14 +2832,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2973,10 +2848,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2989,7 +2860,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3015,6 +2886,19 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -3027,8 +2911,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. + /// Updates the properties of an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -3036,7 +2919,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// + /// /// The parameters to provide for the current database account. /// /// @@ -3060,31 +2943,22 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateParameters"); - } - if (createUpdateParameters != null) - { - createUpdateParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (updateParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateParameters"); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3119,7 +2993,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3129,25 +3002,24 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateParameters", createUpdateParameters); + tracingParameters.Add("updateParameters", updateParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3156,7 +3028,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3185,9 +3057,9 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateParameters != null) + if(updateParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -3215,14 +3087,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3232,10 +3103,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3248,7 +3115,7 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3274,6 +3141,19 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -3318,17 +3198,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3363,7 +3238,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3373,7 +3247,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -3383,14 +3256,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3452,14 +3325,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3469,10 +3341,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3565,17 +3433,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { failoverParameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3610,7 +3473,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3620,7 +3482,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("failoverParameters", failoverParameters); @@ -3631,14 +3492,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3706,14 +3567,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3723,10 +3583,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3816,17 +3672,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { regionParameterForOffline.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3861,7 +3712,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3871,7 +3721,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("regionParameterForOffline", regionParameterForOffline); @@ -3882,14 +3731,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4062,17 +3911,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { regionParameterForOnline.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4107,7 +3951,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4117,7 +3960,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("regionParameterForOnline", regionParameterForOnline); @@ -4128,14 +3970,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4308,17 +4150,12 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) { keyToRegenerate.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4353,7 +4190,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4363,7 +4199,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("keyToRegenerate", keyToRegenerate); @@ -4374,14 +4209,14 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4449,14 +4284,13 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4466,10 +4300,6 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4513,6 +4343,894 @@ internal DatabaseAccountsOperations (CosmosDBManagementClient client) + } + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves metric definitions for the given database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the usages (most recent data) for the given database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsagesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperationsExtensions.cs index f85701c0a5e3..df3d79ef12ef 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseAccountsOperationsExtensions.cs @@ -12,6 +12,107 @@ namespace Microsoft.Azure.Management.CosmosDB /// public static partial class DatabaseAccountsOperationsExtensions { + /// + /// Checks that the Azure Cosmos DB account name already exists. A valid + /// account name may contain only lowercase letters, numbers, and the '-' + /// character, and must be between 3 and 50 characters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Cosmos DB database account name. + /// + public static bool CheckNameExists(this IDatabaseAccountsOperations operations, string accountName) + { + return ((IDatabaseAccountsOperations)operations).CheckNameExistsAsync(accountName).GetAwaiter().GetResult(); + } + + /// + /// Checks that the Azure Cosmos DB account name already exists. A valid + /// account name may contain only lowercase letters, numbers, and the '-' + /// character, and must be between 3 and 50 characters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CheckNameExistsAsync(this IDatabaseAccountsOperations operations, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CheckNameExistsWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IDatabaseAccountsOperations operations) + { + return ((IDatabaseAccountsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IDatabaseAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IDatabaseAccountsOperations operations, string resourceGroupName) + { + return ((IDatabaseAccountsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Retrieves the properties of an existing Azure Cosmos DB database account. /// @@ -52,7 +153,8 @@ public static DatabaseAccountGetResults Get(this IDatabaseAccountsOperations ope } } /// - /// Updates the properties of an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The operations group for this extension method. @@ -63,13 +165,14 @@ public static DatabaseAccountGetResults Get(this IDatabaseAccountsOperations ope /// /// Cosmos DB database account name. /// - public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters) + public static DatabaseAccountGetResults CreateOrUpdate(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { - return ((IDatabaseAccountsOperations)operations).UpdateAsync(resourceGroupName, accountName, updateParameters).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).CreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).GetAwaiter().GetResult(); } /// - /// Updates the properties of an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The operations group for this extension method. @@ -83,16 +186,15 @@ public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, updateParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. + /// Updates the properties of an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -103,14 +205,13 @@ public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations /// /// Cosmos DB database account name. /// - public static DatabaseAccountGetResults CreateOrUpdate(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) + public static DatabaseAccountGetResults Update(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters) { - return ((IDatabaseAccountsOperations)operations).CreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).UpdateAsync(resourceGroupName, accountName, updateParameters).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. + /// Updates the properties of an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -124,9 +225,9 @@ public static DatabaseAccountGetResults CreateOrUpdate(this IDatabaseAccountsOpe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, updateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -218,37 +319,48 @@ public static DatabaseAccountsFailoverPriorityChangeHeaders FailoverPriorityChan } } /// - /// Lists all the Azure Cosmos DB database accounts available under the - /// subscription. + /// Lists the connection strings for the specified Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IDatabaseAccountsOperations operations) + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + public static DatabaseAccountListConnectionStringsResult ListConnectionStrings(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) { - return ((IDatabaseAccountsOperations)operations).ListAsync().GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).ListConnectionStringsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Lists all the Azure Cosmos DB database accounts available under the - /// subscription. + /// Lists the connection strings for the specified Azure Cosmos DB database + /// 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 System.Threading.Tasks.Task> ListAsync(this IDatabaseAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task ListConnectionStringsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListConnectionStringsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all the Azure Cosmos DB database accounts available under the given - /// resource group. + /// Lists the access keys for the specified Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -256,14 +368,16 @@ public static System.Collections.Generic.IEnumerable /// /// The name of the resource group. The name is case insensitive. /// - public static System.Collections.Generic.IEnumerable ListByResourceGroup(this IDatabaseAccountsOperations operations, string resourceGroupName) + /// + /// Cosmos DB database account name. + /// + public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) { - return ((IDatabaseAccountsOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).ListKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Lists all the Azure Cosmos DB database accounts available under the given - /// resource group. + /// Lists the access keys for the specified Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -271,18 +385,21 @@ public static System.Collections.Generic.IEnumerable /// /// The name of the resource group. The name is case insensitive. /// + /// + /// Cosmos DB database account name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task ListKeysAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the access keys for the specified Azure Cosmos DB database account. + /// Retrieves metric definitions for the given database account. /// /// /// The operations group for this extension method. @@ -293,13 +410,13 @@ public static System.Collections.Generic.IEnumerable /// /// Cosmos DB database account name. /// - public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListMetricDefinitions(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) { - return ((IDatabaseAccountsOperations)operations).ListKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Lists the access keys for the specified Azure Cosmos DB database account. + /// Retrieves metric definitions for the given database account. /// /// /// The operations group for this extension method. @@ -313,15 +430,15 @@ public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOpera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListKeysAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the connection strings for the specified Azure Cosmos DB database + /// Retrieves the metrics determined by the given filter for the given database /// account. /// /// @@ -333,13 +450,19 @@ public static DatabaseAccountListKeysResult ListKeys(this IDatabaseAccountsOpera /// /// Cosmos DB database account name. /// - public static DatabaseAccountListConnectionStringsResult ListConnectionStrings(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) + /// + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. + /// + public static Microsoft.Rest.Azure.IPage ListMetrics(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter) { - return ((IDatabaseAccountsOperations)operations).ListConnectionStringsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).ListMetricsAsync(resourceGroupName, accountName, filter).GetAwaiter().GetResult(); } /// - /// Lists the connection strings for the specified Azure Cosmos DB database + /// Retrieves the metrics determined by the given filter for the given database /// account. /// /// @@ -351,12 +474,18 @@ public static DatabaseAccountListConnectionStringsResult ListConnectionStrings(t /// /// Cosmos DB database account name. /// + /// + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ListConnectionStringsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListConnectionStringsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -567,96 +696,6 @@ public static DatabaseAccountsRegenerateKeyHeaders RegenerateKey(this IDatabaseA } } /// - /// Checks that the Azure Cosmos DB account name already exists. A valid - /// account name may contain only lowercase letters, numbers, and the '-' - /// character, and must be between 3 and 50 characters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Cosmos DB database account name. - /// - public static bool CheckNameExists(this IDatabaseAccountsOperations operations, string accountName) - { - return ((IDatabaseAccountsOperations)operations).CheckNameExistsAsync(accountName).GetAwaiter().GetResult(); - } - - /// - /// Checks that the Azure Cosmos DB account name already exists. A valid - /// account name may contain only lowercase letters, numbers, and the '-' - /// character, and must be between 3 and 50 characters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task CheckNameExistsAsync(this IDatabaseAccountsOperations operations, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.CheckNameExistsWithHttpMessagesAsync(accountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// - /// Retrieves the metrics determined by the given filter for the given database - /// account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. - /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter) - { - return ((IDatabaseAccountsOperations)operations).ListMetricsAsync(resourceGroupName, accountName, filter).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the metrics determined by the given filter for the given database - /// account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Retrieves the usages (most recent data) for the given database account. /// /// @@ -673,7 +712,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// supported parameter is name.value (name of the metric, can have an or of /// multiple names). /// - public static System.Collections.Generic.IEnumerable ListUsages(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter = default(string)) + public static Microsoft.Rest.Azure.IPage ListUsages(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter = default(string)) { return ((IDatabaseAccountsOperations)operations).ListUsagesAsync(resourceGroupName, accountName, filter).GetAwaiter().GetResult(); } @@ -698,7 +737,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsagesAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, accountName, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -706,7 +745,8 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID } } /// - /// Retrieves metric definitions for the given database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The operations group for this extension method. @@ -717,13 +757,14 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListMetricDefinitions(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName) + public static DatabaseAccountGetResults BeginCreateOrUpdate(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { - return ((IDatabaseAccountsOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IDatabaseAccountsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).GetAwaiter().GetResult(); } /// - /// Retrieves metric definitions for the given database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The operations group for this extension method. @@ -737,9 +778,9 @@ public static System.Collections.Generic.IEnumerable ListMetri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -784,47 +825,6 @@ public static DatabaseAccountGetResults BeginUpdate(this IDatabaseAccountsOperat } } /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an 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 DatabaseAccountGetResults BeginCreateOrUpdate(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) - { - return ((IDatabaseAccountsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an 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 System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IDatabaseAccountsOperations operations, string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Deletes an existing Azure Cosmos DB database account. /// /// @@ -1033,5 +1033,176 @@ public static DatabaseAccountsRegenerateKeyHeaders BeginRegenerateKey(this IData return _result.Headers; } } + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IDatabaseAccountsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IDatabaseAccountsOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves metric definitions for the given database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricDefinitionsNext(this IDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IDatabaseAccountsOperations)operations).ListMetricDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves metric definitions for the given database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricDefinitionsNextAsync(this IDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IDatabaseAccountsOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the usages (most recent data) for the given database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListUsagesNext(this IDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IDatabaseAccountsOperations)operations).ListUsagesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the usages (most recent data) for the given database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListUsagesNextAsync(this IDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListUsagesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperations.cs index a94d5d85123b..3166705db060 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperations.cs @@ -39,8 +39,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) public CosmosDBManagementClient Client { get; private set; } /// - /// Retrieves the metrics determined by the given filter for the given database - /// account and database. + /// Retrieves metric definitions for the given database. /// /// /// The name of the resource group. The name is case insensitive. @@ -51,12 +50,6 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// /// Cosmos DB database rid. /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. - /// /// /// Headers that will be added to request. /// @@ -78,23 +71,18 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -134,12 +122,6 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseRid"); } - if (filter == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -150,30 +132,24 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (filter != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -235,14 +211,13 @@ internal DatabaseOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -252,10 +227,6 @@ internal DatabaseOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -268,7 +239,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -282,7 +253,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -306,7 +277,8 @@ internal DatabaseOperations (CosmosDBManagementClient client) } /// - /// Retrieves the usages (most recent data) for the given database. + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. /// /// /// The name of the resource group. The name is case insensitive. @@ -318,9 +290,10 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// Cosmos DB database rid. /// /// - /// An OData filter expression that describes a subset of usages to return. The - /// supported parameter is name.value (name of the metric, can have an or of - /// multiple names). + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. /// /// /// Headers that will be added to request. @@ -343,23 +316,18 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -399,8 +367,11 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseRid"); } + if (filter == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); + } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -411,26 +382,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetrics", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -496,14 +466,13 @@ internal DatabaseOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -513,10 +482,6 @@ internal DatabaseOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -529,7 +494,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -543,7 +508,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -567,7 +532,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) } /// - /// Retrieves metric definitions for the given database. + /// Retrieves the usages (most recent data) for the given database. /// /// /// The name of the resource group. The name is case insensitive. @@ -578,6 +543,11 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// /// Cosmos DB database rid. /// + /// + /// An OData filter expression that describes a subset of usages to return. The + /// supported parameter is name.value (name of the metric, can have an or of + /// multiple names). + /// /// /// Headers that will be added to request. /// @@ -599,23 +569,18 @@ internal DatabaseOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -655,7 +620,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseRid"); } - string apiVersion = "2025-10-15"; + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -666,25 +631,29 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsages", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -746,14 +715,13 @@ internal DatabaseOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -763,10 +731,183 @@ internal DatabaseOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + // Ignore the exception } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -779,7 +920,7 @@ internal DatabaseOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -815,6 +956,361 @@ internal DatabaseOperations (CosmosDBManagementClient client) + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the usages (most recent data) for the given database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListUsagesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperationsExtensions.cs index b9f9f4cd6928..1c063aa1e2b3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/DatabaseOperationsExtensions.cs @@ -12,6 +12,51 @@ namespace Microsoft.Azure.Management.CosmosDB /// public static partial class DatabaseOperationsExtensions { + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + public static Microsoft.Rest.Azure.IPage ListMetricDefinitions(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid) + { + return ((IDatabaseOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid).GetAwaiter().GetResult(); + } + + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Retrieves the metrics determined by the given filter for the given database /// account and database. @@ -34,7 +79,7 @@ public static partial class DatabaseOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter) { return ((IDatabaseOperations)operations).ListMetricsAsync(resourceGroupName, accountName, databaseRid, filter).GetAwaiter().GetResult(); } @@ -64,7 +109,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -91,7 +136,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// supported parameter is name.value (name of the metric, can have an or of /// multiple names). /// - public static System.Collections.Generic.IEnumerable ListUsages(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter = default(string)) + public static Microsoft.Rest.Azure.IPage ListUsages(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter = default(string)) { return ((IDatabaseOperations)operations).ListUsagesAsync(resourceGroupName, accountName, databaseRid, filter).GetAwaiter().GetResult(); } @@ -119,7 +164,7 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListUsagesAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -132,41 +177,97 @@ public static System.Collections.Generic.IEnumerable ListMetrics(this ID /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + public static Microsoft.Rest.Azure.IPage ListMetricDefinitionsNext(this IDatabaseOperations operations, string nextPageLink) + { + return ((IDatabaseOperations)operations).ListMetricDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// The operations group for this extension method. /// - /// - /// Cosmos DB database rid. + /// + /// The NextLink from the previous successful call to List operation. /// - public static System.Collections.Generic.IEnumerable ListMetricDefinitions(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid) + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricDefinitionsNextAsync(this IDatabaseOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - return ((IDatabaseOperations)operations).ListMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid).GetAwaiter().GetResult(); + using (var _result = await operations.ListMetricDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IDatabaseOperations operations, string nextPageLink) + { + return ((IDatabaseOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves metric definitions for the given database. + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The cancellation token. /// - /// - /// Cosmos DB database rid. + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IDatabaseOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the usages (most recent data) for the given database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListUsagesNext(this IDatabaseOperations operations, string nextPageLink) + { + return ((IDatabaseOperations)operations).ListUsagesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the usages (most recent data) for the given database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricDefinitionsAsync(this IDatabaseOperations operations, string resourceGroupName, string accountName, string databaseRid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListUsagesNextAsync(this IDatabaseOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListUsagesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetOperations.cs index 20c4c6979db6..3629ab6bc919 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetOperations.cs @@ -68,18 +68,12 @@ internal FleetOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2025-10-15"; + + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -87,7 +81,6 @@ internal FleetOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -97,12 +90,12 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -164,11 +157,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -206,7 +199,7 @@ internal FleetOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -262,17 +255,12 @@ internal FleetOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -288,7 +276,6 @@ internal FleetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +284,6 @@ internal FleetOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -307,13 +293,13 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -375,11 +361,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -417,7 +403,7 @@ internal FleetOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -477,17 +463,12 @@ internal FleetOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -522,7 +503,6 @@ internal FleetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -532,7 +512,6 @@ internal FleetOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -542,14 +521,14 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -611,11 +590,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -723,17 +702,12 @@ internal FleetOperations (CosmosDBManagementClient client) { body.Validate(); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -768,7 +742,6 @@ internal FleetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -778,7 +751,6 @@ internal FleetOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); @@ -789,14 +761,14 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -864,11 +836,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -986,17 +958,12 @@ internal FleetOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1031,7 +998,6 @@ internal FleetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1041,7 +1007,6 @@ internal FleetOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); @@ -1052,14 +1017,14 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1127,11 +1092,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1247,17 +1212,12 @@ internal FleetOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1292,7 +1252,6 @@ internal FleetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1302,7 +1261,6 @@ internal FleetOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1312,14 +1270,14 @@ internal FleetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1381,11 +1339,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1553,11 +1511,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1595,7 +1553,7 @@ internal FleetOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1730,11 +1688,11 @@ internal FleetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1772,7 +1730,7 @@ internal FleetOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceAccountOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceAccountOperations.cs index 60702937e6fd..f04fb1640ae1 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceAccountOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceAccountOperations.cs @@ -77,17 +77,12 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -141,7 +136,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -152,7 +146,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -162,15 +155,15 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -232,11 +225,11 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -274,7 +267,7 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -340,17 +333,12 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -423,7 +411,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceAccountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -435,7 +422,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); tracingParameters.Add("fleetspaceAccountName", fleetspaceAccountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -445,16 +431,16 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); _url = _url.Replace("{fleetspaceAccountName}", System.Uri.EscapeDataString(fleetspaceAccountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -516,11 +502,11 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -605,10 +591,10 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, body, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, body, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -679,7 +665,7 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -690,17 +676,12 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "body"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -773,7 +754,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceAccountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +765,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); tracingParameters.Add("fleetspaceAccountName", fleetspaceAccountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); @@ -796,16 +775,16 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); _url = _url.Replace("{fleetspaceAccountName}", System.Uri.EscapeDataString(fleetspaceAccountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -873,11 +852,11 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -901,7 +880,7 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -945,6 +924,19 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -995,17 +987,12 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1078,7 +1065,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceAccountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1090,7 +1076,6 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); tracingParameters.Add("fleetspaceAccountName", fleetspaceAccountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1100,16 +1085,16 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); _url = _url.Replace("{fleetspaceAccountName}", System.Uri.EscapeDataString(fleetspaceAccountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1171,11 +1156,11 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1343,11 +1328,11 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1385,7 +1370,7 @@ internal FleetspaceAccountOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceOperations.cs index 333e0174b800..45d7f0f50b0b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/FleetspaceOperations.cs @@ -74,17 +74,12 @@ internal FleetspaceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +123,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -139,14 +132,14 @@ internal FleetspaceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -208,11 +201,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -250,7 +243,7 @@ internal FleetspaceOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -313,17 +306,12 @@ internal FleetspaceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -377,7 +365,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -388,7 +375,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -398,15 +384,15 @@ internal FleetspaceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -468,11 +454,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -554,10 +540,10 @@ internal FleetspaceOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, fleetName, fleetspaceName, body, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, fleetName, fleetspaceName, body, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -651,7 +637,7 @@ internal FleetspaceOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -665,17 +651,12 @@ internal FleetspaceOperations (CosmosDBManagementClient client) { body.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -729,7 +710,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +720,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); @@ -751,15 +730,15 @@ internal FleetspaceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -827,11 +806,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -855,7 +834,7 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -899,6 +878,19 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -953,17 +945,12 @@ internal FleetspaceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1017,7 +1004,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1028,7 +1014,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("body", body); @@ -1039,15 +1024,15 @@ internal FleetspaceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1115,11 +1100,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1229,17 +1214,12 @@ internal FleetspaceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1293,7 +1273,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "fleetspaceName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1304,7 +1283,6 @@ internal FleetspaceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fleetName", fleetName); tracingParameters.Add("fleetspaceName", fleetspaceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1314,15 +1292,15 @@ internal FleetspaceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{fleetName}", System.Uri.EscapeDataString(fleetName)); _url = _url.Replace("{fleetspaceName}", System.Uri.EscapeDataString(fleetspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1384,11 +1362,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1556,11 +1534,11 @@ internal FleetspaceOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1598,7 +1576,7 @@ internal FleetspaceOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperations.cs index b5fd0dfa8344..76c792f1e67c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperations.cs @@ -69,23 +69,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListGremlinDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListGremlinDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -120,7 +115,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +124,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -140,14 +133,14 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -209,14 +202,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +218,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -242,7 +230,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -319,17 +307,12 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -369,7 +352,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -380,7 +362,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); @@ -390,15 +371,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -460,14 +441,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -477,10 +457,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -584,8 +560,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the RUs per second of the Gremlin database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -617,23 +592,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListGremlinGraphsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -673,7 +643,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -684,25 +653,24 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinGraphs", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -764,14 +732,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -781,10 +748,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -797,7 +760,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -811,7 +774,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -835,63 +798,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -902,30 +809,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. + /// + /// Cosmos DB graph name. /// /// /// Headers that will be added to request. @@ -948,23 +833,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListGremlinGraphsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1004,7 +884,11 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (graphName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1015,25 +899,26 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("graphName", graphName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinGraphs", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraph", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1095,14 +980,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1112,10 +996,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1128,7 +1008,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1142,7 +1022,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1166,7 +1046,98 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB Gremlin graph + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The parameters to provide for the current Gremlin graph. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves continuous backup information for a gremlin graph. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The name of the continuous backup restore location. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -1201,23 +1172,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1262,7 +1228,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1274,26 +1239,25 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraph", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraphThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1355,14 +1319,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1372,10 +1335,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1388,7 +1347,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1402,7 +1361,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1426,7 +1385,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The name of the resource group. The name is case insensitive. @@ -1440,8 +1399,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// - /// - /// The parameters to provide for the current Gremlin graph. + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// graph. /// /// /// Headers that will be added to request. @@ -1449,15 +1409,16 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -1477,16 +1438,16 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB - /// database account with the provided name. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1506,6 +1467,32 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// + public async System.Threading.Tasks.Task> MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the Gremlin database under an existing Azure + /// Cosmos DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// /// /// Thrown when the operation returned an invalid status code /// @@ -1521,23 +1508,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1577,12 +1559,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (graphName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1593,27 +1569,24 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinGraphThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinDatabaseThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1675,14 +1648,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1692,10 +1664,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1746,7 +1714,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// /// The name of the resource group. The name is case insensitive. @@ -1757,12 +1725,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The RUs per second of the parameters to provide for the current Gremlin - /// graph. + /// database. /// /// /// Headers that will be added to request. @@ -1770,15 +1735,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to /// autoscale /// /// @@ -1790,24 +1755,21 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual /// throughput /// /// @@ -1819,55 +1781,21 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves continuous backup information for a gremlin graph. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. - /// - /// - /// The name of the continuous backup restore location. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Create or update an Azure Cosmos DB Gremlin database + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. /// /// /// The name of the resource group. The name is case insensitive. @@ -1875,12 +1803,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// The parameters to provide for the current Gremlin database. - /// /// /// Headers that will be added to request. /// @@ -1902,31 +1824,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListGremlinRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateGremlinDatabaseParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinDatabaseParameters"); - } - if (createUpdateGremlinDatabaseParameters != null) - { - createUpdateGremlinDatabaseParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1961,12 +1870,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1976,27 +1879,23 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateGremlinDatabaseParameters", createUpdateGremlinDatabaseParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinDatabase", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinRoleAssignments", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2005,7 +1904,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2034,12 +1933,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateGremlinDatabaseParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinDatabaseParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2062,16 +1955,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2081,10 +1973,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2097,7 +1985,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2111,7 +1999,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2123,19 +2011,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2148,7 +2023,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Gremlin database. + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -2156,8 +2032,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -2168,6 +2044,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -2177,23 +2056,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2228,12 +2102,11 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) + if (roleAssignmentId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2243,26 +2116,25 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinDatabase", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2271,7 +2143,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2322,16 +2194,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2341,10 +2212,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2357,7 +2224,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2365,18 +2232,23 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) + // Deserialize Response + if ((int)_statusCode == 200) { - _httpRequest.Dispose(); - if (_httpResponse != null) + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try { - _httpResponse.Dispose(); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -2390,7 +2262,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -2398,12 +2270,58 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// database. + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. /// /// /// Headers that will be added to request. @@ -2426,31 +2344,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListGremlinRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) + if (this.Client.ApiVersion == null) { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2485,12 +2390,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2500,27 +2399,23 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinRoleDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2529,7 +2424,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2558,12 +2453,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -2586,16 +2475,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2605,10 +2493,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2621,7 +2505,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2635,7 +2519,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2647,19 +2531,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2672,8 +2543,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Definition with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -2681,8 +2552,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -2705,23 +2576,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2756,12 +2622,11 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) + if (roleDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2771,26 +2636,25 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinDatabaseToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetGremlinRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2799,7 +2663,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2850,16 +2714,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2869,10 +2732,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2885,7 +2744,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2899,7 +2758,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2911,19 +2770,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -2936,8 +2782,60 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update an Azure Cosmos DB Gremlin database /// /// /// The name of the resource group. The name is case insensitive. @@ -2948,6 +2846,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// The parameters to provide for the current Gremlin database. + /// /// /// Headers that will be added to request. /// @@ -2969,23 +2870,26 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateGremlinDatabaseParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinDatabaseParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateGremlinDatabaseParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateGremlinDatabaseParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3025,7 +2929,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3036,25 +2939,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinDatabaseToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinDatabase", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3063,7 +2966,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3092,6 +2995,12 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateGremlinDatabaseParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinDatabaseParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -3116,14 +3025,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3133,10 +3041,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3149,7 +3053,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3163,7 +3067,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3177,7 +3081,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3200,7 +3104,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// /// The name of the resource group. The name is case insensitive. @@ -3211,12 +3115,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - /// - /// The parameters to provide for the current Gremlin graph. - /// /// /// Headers that will be added to request. /// @@ -3226,9 +3124,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3238,31 +3133,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateGremlinGraphParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinGraphParameters"); - } - if (createUpdateGremlinGraphParameters != null) - { - createUpdateGremlinGraphParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3302,12 +3184,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (graphName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3318,28 +3194,24 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateGremlinGraphParameters", createUpdateGremlinGraphParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinGraph", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinDatabase", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3348,7 +3220,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3377,12 +3249,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateGremlinGraphParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinGraphParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -3405,16 +3271,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3424,10 +3289,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3440,7 +3301,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3448,27 +3309,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3491,7 +3334,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Create or update an Azure Cosmos DB Gremlin graph /// /// /// The name of the resource group. The name is case insensitive. @@ -3505,6 +3348,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// + /// + /// The parameters to provide for the current Gremlin graph. + /// /// /// Headers that will be added to request. /// @@ -3514,6 +3360,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -3523,23 +3372,26 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateGremlinGraphParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinGraphParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateGremlinGraphParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateGremlinGraphParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3584,7 +3436,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3596,26 +3447,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinGraph", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinGraph", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3624,7 +3475,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3653,6 +3504,12 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateGremlinGraphParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinGraphParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -3675,16 +3532,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3694,10 +3550,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3710,7 +3562,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3718,9 +3570,27 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3743,7 +3613,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// /// The name of the resource group. The name is case insensitive. @@ -3757,10 +3627,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// graph. - /// /// /// Headers that will be added to request. /// @@ -3770,9 +3636,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3782,31 +3645,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) - { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3851,7 +3701,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3863,27 +3712,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinGraphThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinGraph", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3892,7 +3739,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3921,12 +3768,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -3949,16 +3790,15 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3968,10 +3808,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3984,7 +3820,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3992,27 +3828,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4035,8 +3853,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The name of the resource group. The name is case insensitive. @@ -4050,6 +3867,9 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// + /// + /// The name of the continuous backup restore location. + /// /// /// Headers that will be added to request. /// @@ -4071,23 +3891,23 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4132,7 +3952,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4144,26 +3963,26 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinGraphToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4201,6 +4020,12 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(location != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -4258,7 +4083,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4272,7 +4097,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4286,7 +4111,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4309,8 +4134,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The name of the resource group. The name is case insensitive. @@ -4324,6 +4148,10 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// graph. + /// /// /// Headers that will be added to request. /// @@ -4345,23 +4173,26 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId != null) + if (updateThroughputParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + updateThroughputParameters.Validate(); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4406,7 +4237,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4418,26 +4248,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinGraphToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinGraphThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4446,7 +4276,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4475,11 +4305,17 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - // Set Credentials - if (this.Client.Credentials != null) + if(updateThroughputParameters != null) { - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) @@ -4499,14 +4335,13 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4516,10 +4351,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4532,7 +4363,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4560,7 +4391,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4583,7 +4414,8 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -4597,9 +4429,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB graph name. /// - /// - /// The name of the continuous backup restore location. - /// /// /// Headers that will be added to request. /// @@ -4621,28 +4450,18 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4687,7 +4506,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4699,27 +4517,25 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("graphName", graphName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinGraphToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4757,12 +4573,6 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(location != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -4820,7 +4630,7 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4834,7 +4644,2772 @@ internal GremlinResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph 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 System.Threading.Tasks.Task> BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + + if (graphName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "graphName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("databaseName", databaseName); + tracingParameters.Add("graphName", graphName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinGraphToManualThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{graphName}", System.Uri.EscapeDataString(graphName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// database. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (updateThroughputParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); + } + if (updateThroughputParameters != null) + { + updateThroughputParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("databaseName", databaseName); + + tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateGremlinDatabaseThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 System.Threading.Tasks.Task> BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("databaseName", databaseName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinDatabaseToAutoscale", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 System.Threading.Tasks.Task> BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("databaseName", databaseName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateGremlinDatabaseToManualThroughput", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateGremlinRoleAssignmentParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinRoleAssignmentParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + tracingParameters.Add("createUpdateGremlinRoleAssignmentParameters", createUpdateGremlinRoleAssignmentParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateGremlinRoleAssignmentParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinRoleAssignmentParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateGremlinRoleDefinitionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateGremlinRoleDefinitionParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + tracingParameters.Add("createUpdateGremlinRoleDefinitionParameters", createUpdateGremlinRoleDefinitionParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateGremlinRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateGremlinRoleDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateGremlinRoleDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteGremlinRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the Gremlin databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListGremlinDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinDatabasesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListGremlinGraphsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinGraphsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListGremlinRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinRoleAssignmentsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListGremlinRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListGremlinRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperationsExtensions.cs index c80de2b299ce..d7b69deb4edd 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/GremlinResourcesOperationsExtensions.cs @@ -25,7 +25,7 @@ public static partial class GremlinResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListGremlinDatabases(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListGremlinDatabases(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName) { return ((IGremlinResourcesOperations)operations).ListGremlinDatabasesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -46,7 +46,7 @@ public static System.Collections.Generic.IEnumerable /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListGremlinDatabasesAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListGremlinDatabasesAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListGremlinDatabasesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -191,8 +191,7 @@ public static GremlinResourcesDeleteGremlinDatabaseHeaders DeleteGremlinDatabase } } /// - /// Gets the RUs per second of the Gremlin database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -206,14 +205,13 @@ public static GremlinResourcesDeleteGremlinDatabaseHeaders DeleteGremlinDatabase /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static Microsoft.Rest.Azure.IPage ListGremlinGraphs(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IGremlinResourcesOperations)operations).GetGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).ListGremlinGraphsAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the Gremlin database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -230,15 +228,15 @@ public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGr /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListGremlinGraphsAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListGremlinGraphsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -252,13 +250,16 @@ public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGr /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + /// + /// Cosmos DB graph name. + /// + public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).UpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).GetGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -272,19 +273,21 @@ public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this /// /// Cosmos DB database name. /// + /// + /// Cosmos DB graph name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -298,14 +301,16 @@ public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults MigrateGremlinDatabaseToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB graph name. + /// + public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return ((IGremlinResourcesOperations)operations).MigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).CreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -319,19 +324,21 @@ public static ThroughputSettingsGetResults MigrateGremlinDatabaseToAutoscale(thi /// /// Cosmos DB database name. /// + /// + /// Cosmos DB graph name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateGremlinDatabaseToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// /// The operations group for this extension method. @@ -345,14 +352,16 @@ public static ThroughputSettingsGetResults MigrateGremlinDatabaseToAutoscale(thi /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults MigrateGremlinDatabaseToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB graph name. + /// + public static GremlinResourcesDeleteGremlinGraphHeaders DeleteGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).MigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).DeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// /// The operations group for this extension method. @@ -366,18 +375,21 @@ public static ThroughputSettingsGetResults MigrateGremlinDatabaseToManualThrough /// /// Cosmos DB database name. /// + /// + /// Cosmos DB graph name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateGremlinDatabaseToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The operations group for this extension method. @@ -391,13 +403,16 @@ public static ThroughputSettingsGetResults MigrateGremlinDatabaseToManualThrough /// /// Cosmos DB database name. /// - public static System.Collections.Generic.IEnumerable ListGremlinGraphs(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB graph name. + /// + public static BackupInformation RetrieveContinuousBackupInformation(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location) { - return ((IGremlinResourcesOperations)operations).ListGremlinGraphsAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, location).GetAwaiter().GetResult(); } /// - /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The operations group for this extension method. @@ -411,18 +426,22 @@ public static System.Collections.Generic.IEnumerable Lis /// /// Cosmos DB database name. /// + /// + /// Cosmos DB graph name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListGremlinGraphsAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListGremlinGraphsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The operations group for this extension method. @@ -439,13 +458,14 @@ public static System.Collections.Generic.IEnumerable Lis /// /// Cosmos DB graph name. /// - public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).GetGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).GetGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The operations group for this extension method. @@ -465,15 +485,15 @@ public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOpera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -490,13 +510,13 @@ public static GremlinGraphGetResults GetGremlinGraph(this IGremlinResourcesOpera /// /// Cosmos DB graph name. /// - public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) + public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IGremlinResourcesOperations)operations).CreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).UpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -516,15 +536,16 @@ public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -541,13 +562,14 @@ public static GremlinGraphGetResults CreateUpdateGremlinGraph(this IGremlinResou /// /// Cosmos DB graph name. /// - public static GremlinResourcesDeleteGremlinGraphHeaders DeleteGremlinGraph(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults MigrateGremlinGraphToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).DeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).MigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -567,16 +589,16 @@ public static GremlinResourcesDeleteGremlinGraphHeaders DeleteGremlinGraph(this /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteGremlinGraphAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateGremlinGraphToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteGremlinGraphWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB - /// database account with the provided name. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -593,14 +615,14 @@ public static GremlinResourcesDeleteGremlinGraphHeaders DeleteGremlinGraph(this /// /// Cosmos DB graph name. /// - public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults MigrateGremlinGraphToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).GetGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).MigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB - /// database account with the provided name. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -620,15 +642,16 @@ public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGreml /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateGremlinGraphToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Gets the RUs per second of the Gremlin database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -642,16 +665,14 @@ public static ThroughputSettingsGetResults GetGremlinGraphThroughput(this IGreml /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static ThroughputSettingsGetResults GetGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IGremlinResourcesOperations)operations).UpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).GetGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Gets the RUs per second of the Gremlin database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -665,22 +686,18 @@ public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGr /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// /// The operations group for this extension method. @@ -694,17 +711,13 @@ public static ThroughputSettingsGetResults UpdateGremlinGraphThroughput(this IGr /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - public static ThroughputSettingsGetResults MigrateGremlinGraphToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults UpdateGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IGremlinResourcesOperations)operations).MigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).UpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB Gremlin database /// /// /// The operations group for this extension method. @@ -718,22 +731,19 @@ public static ThroughputSettingsGetResults MigrateGremlinGraphToAutoscale(this I /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateGremlinGraphToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -747,17 +757,14 @@ public static ThroughputSettingsGetResults MigrateGremlinGraphToAutoscale(this I /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - public static ThroughputSettingsGetResults MigrateGremlinGraphToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults MigrateGremlinDatabaseToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IGremlinResourcesOperations)operations).MigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).MigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -771,21 +778,19 @@ public static ThroughputSettingsGetResults MigrateGremlinGraphToManualThroughput /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateGremlinGraphToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateGremlinDatabaseToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -799,16 +804,14 @@ public static ThroughputSettingsGetResults MigrateGremlinGraphToManualThroughput /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// - public static BackupInformation RetrieveContinuousBackupInformation(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location) + public static ThroughputSettingsGetResults MigrateGremlinDatabaseToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IGremlinResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, location).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).MigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -822,21 +825,18 @@ public static BackupInformation RetrieveContinuousBackupInformation(this IGremli /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateGremlinDatabaseToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Gremlin database + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. /// /// /// The operations group for this extension method. @@ -847,16 +847,13 @@ public static BackupInformation RetrieveContinuousBackupInformation(this IGremli /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) + public static Microsoft.Rest.Azure.IPage ListGremlinRoleAssignments(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName) { - return ((IGremlinResourcesOperations)operations).BeginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).ListGremlinRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Gremlin database + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. /// /// /// The operations group for this extension method. @@ -867,21 +864,19 @@ public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IG /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateGremlinDatabaseAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListGremlinRoleAssignmentsAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListGremlinRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Gremlin database. + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -892,16 +887,17 @@ public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IG /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// - public static GremlinResourcesDeleteGremlinDatabaseHeaders BeginDeleteGremlinDatabase(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static GremlinRoleAssignmentResource GetGremlinRoleAssignment(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((IGremlinResourcesOperations)operations).BeginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).GetGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Gremlin database. + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -912,21 +908,21 @@ public static GremlinResourcesDeleteGremlinDatabaseHeaders BeginDeleteGremlinDat /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteGremlinDatabaseAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetGremlinRoleAssignmentAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteGremlinDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// /// The operations group for this extension method. @@ -937,16 +933,16 @@ public static GremlinResourcesDeleteGremlinDatabaseHeaders BeginDeleteGremlinDat /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// - public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static GremlinRoleAssignmentResource CreateUpdateGremlinRoleAssignment(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters) { - return ((IGremlinResourcesOperations)operations).BeginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).CreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// /// The operations group for this extension method. @@ -957,22 +953,242 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput( /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateGremlinRoleAssignmentAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static GremlinResourcesDeleteGremlinRoleAssignmentHeaders DeleteGremlinRoleAssignment(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((IGremlinResourcesOperations)operations).DeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteGremlinRoleAssignmentAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// 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 Microsoft.Rest.Azure.IPage ListGremlinRoleDefinitions(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((IGremlinResourcesOperations)operations).ListGremlinRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// 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 System.Threading.Tasks.Task> ListGremlinRoleDefinitionsAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGremlinRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static GremlinRoleDefinitionResource GetGremlinRoleDefinition(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IGremlinResourcesOperations)operations).GetGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetGremlinRoleDefinitionAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static GremlinRoleDefinitionResource CreateUpdateGremlinRoleDefinition(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters) + { + return ((IGremlinResourcesOperations)operations).CreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateUpdateGremlinRoleDefinitionAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static GremlinResourcesDeleteGremlinRoleDefinitionHeaders DeleteGremlinRoleDefinition(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IGremlinResourcesOperations)operations).DeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteGremlinRoleDefinitionAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Create or update an Azure Cosmos DB Gremlin database /// /// /// The operations group for this extension method. @@ -986,14 +1202,13 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput( /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static GremlinDatabaseGetResults BeginCreateUpdateGremlinDatabase(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { - return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Gremlin database /// /// /// The operations group for this extension method. @@ -1010,16 +1225,15 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToAutoscal /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateGremlinDatabaseToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateGremlinDatabaseAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// /// The operations group for this extension method. @@ -1033,14 +1247,13 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToAutoscal /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static GremlinResourcesDeleteGremlinDatabaseHeaders BeginDeleteGremlinDatabase(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// /// The operations group for this extension method. @@ -1057,11 +1270,11 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToManualTh /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateGremlinDatabaseToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteGremlinDatabaseAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteGremlinDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// @@ -1167,7 +1380,7 @@ public static GremlinResourcesDeleteGremlinGraphHeaders BeginDeleteGremlinGraph( } } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The operations group for this extension method. @@ -1184,13 +1397,13 @@ public static GremlinResourcesDeleteGremlinGraphHeaders BeginDeleteGremlinGraph( /// /// Cosmos DB graph name. /// - public static ThroughputSettingsGetResults BeginUpdateGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static BackupInformation BeginRetrieveContinuousBackupInformation(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location) { - return ((IGremlinResourcesOperations)operations).BeginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, location).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The operations group for this extension method. @@ -1210,16 +1423,15 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinGraphThroughput(thi /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -1236,14 +1448,13 @@ public static ThroughputSettingsGetResults BeginUpdateGremlinGraphThroughput(thi /// /// Cosmos DB graph name. /// - public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults BeginUpdateGremlinGraphThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The operations group for this extension method. @@ -1263,16 +1474,16 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToAutoscale(t /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateGremlinGraphToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateGremlinGraphThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -1289,14 +1500,14 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToAutoscale(t /// /// Cosmos DB graph name. /// - public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) + public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -1316,15 +1527,16 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToManualThrou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateGremlinGraphToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateGremlinGraphToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1341,13 +1553,14 @@ public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToManualThrou /// /// Cosmos DB graph name. /// - public static BackupInformation BeginRetrieveContinuousBackupInformation(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location) + public static ThroughputSettingsGetResults BeginMigrateGremlinGraphToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName) { - return ((IGremlinResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, location).GetAwaiter().GetResult(); + return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a gremlin graph. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1367,9 +1580,462 @@ public static BackupInformation BeginRetrieveContinuousBackupInformation(this IG /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateGremlinGraphToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string graphName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, graphName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginUpdateGremlinDatabaseThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + { + return ((IGremlinResourcesOperations)operations).BeginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + } + + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateGremlinDatabaseThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateGremlinDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToAutoscale(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + { + return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMigrateGremlinDatabaseToAutoscaleAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginMigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginMigrateGremlinDatabaseToManualThroughput(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + { + return ((IGremlinResourcesOperations)operations).BeginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginMigrateGremlinDatabaseToManualThroughputAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static GremlinRoleAssignmentResource BeginCreateUpdateGremlinRoleAssignment(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters) + { + return ((IGremlinResourcesOperations)operations).BeginCreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateGremlinRoleAssignmentAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static GremlinResourcesDeleteGremlinRoleAssignmentHeaders BeginDeleteGremlinRoleAssignment(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((IGremlinResourcesOperations)operations).BeginDeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteGremlinRoleAssignmentAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteGremlinRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static GremlinRoleDefinitionResource BeginCreateUpdateGremlinRoleDefinition(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters) + { + return ((IGremlinResourcesOperations)operations).BeginCreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateGremlinRoleDefinitionAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static GremlinResourcesDeleteGremlinRoleDefinitionHeaders BeginDeleteGremlinRoleDefinition(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IGremlinResourcesOperations)operations).BeginDeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteGremlinRoleDefinitionAsync(this IGremlinResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteGremlinRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Lists the Gremlin databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListGremlinDatabasesNext(this IGremlinResourcesOperations operations, string nextPageLink) + { + return ((IGremlinResourcesOperations)operations).ListGremlinDatabasesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the Gremlin databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListGremlinDatabasesNextAsync(this IGremlinResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGremlinDatabasesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListGremlinGraphsNext(this IGremlinResourcesOperations operations, string nextPageLink) + { + return ((IGremlinResourcesOperations)operations).ListGremlinGraphsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListGremlinGraphsNextAsync(this IGremlinResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGremlinGraphsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListGremlinRoleAssignmentsNext(this IGremlinResourcesOperations operations, string nextPageLink) + { + return ((IGremlinResourcesOperations)operations).ListGremlinRoleAssignmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListGremlinRoleAssignmentsNextAsync(this IGremlinResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGremlinRoleAssignmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListGremlinRoleDefinitionsNext(this IGremlinResourcesOperations operations, string nextPageLink) + { + return ((IGremlinResourcesOperations)operations).ListGremlinRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListGremlinRoleDefinitionsNextAsync(this IGremlinResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListGremlinRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraClustersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraClustersOperations.cs index 2d72f4ec678f..bc0ff2a60c07 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraClustersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraClustersOperations.cs @@ -31,7 +31,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List all managed Cassandra clusters in this resource group. @@ -54,7 +54,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get the properties of a managed Cassandra cluster. @@ -82,29 +82,6 @@ public partial interface ICassandraClustersOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Deletes a managed Cassandra cluster. - /// - /// - /// Deletes a managed Cassandra cluster. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Managed Cassandra cluster name. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// /// Create or update a managed Cassandra cluster. When updating, you must /// specify all writable properties. To update only some properties, use PATCH. @@ -135,7 +112,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates some of the properties of a managed Cassandra cluster. @@ -164,13 +141,13 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deletes a managed Cassandra cluster. /// /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deletes a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -178,9 +155,6 @@ public partial interface ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// - /// - /// Specification which command to run where - /// /// /// The headers that will be added to request. /// @@ -190,10 +164,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> InvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. @@ -213,6 +184,10 @@ public partial interface ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// /// /// The headers that will be added to request. /// @@ -222,19 +197,13 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will - /// start the host virtual machine of this cluster with reserved data disk. - /// This won't do anything on an already running cluster. Use Deallocate to - /// deallocate the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// - /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will - /// start the host virtual machine of this cluster with reserved data disk. - /// This won't do anything on an already running cluster. Use Deallocate to - /// deallocate the cluster. + /// Invoke a command like nodetool for cassandra maintenance /// /// /// The name of the resource group. The name is case insensitive. @@ -242,6 +211,9 @@ public partial interface ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// + /// + /// Specification which command to run where + /// /// /// The headers that will be added to request. /// @@ -251,15 +223,22 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> InvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in - /// a cluster. + /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will + /// start the host virtual machine of this cluster with reserved data disk. + /// This won't do anything on an already running cluster. Use Deallocate to + /// deallocate the cluster. /// /// - /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in - /// a cluster. + /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will + /// start the host virtual machine of this cluster with reserved data disk. + /// This won't do anything on an already running cluster. Use Deallocate to + /// deallocate the cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -276,16 +255,15 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> StatusWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes a managed Cassandra cluster. + /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in + /// a cluster. /// /// - /// Deletes a managed Cassandra cluster. + /// Gets the CPU, memory, and disk usage statistics for each Cassandra node in + /// a cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -302,7 +280,10 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> StatusWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create or update a managed Cassandra cluster. When updating, you must @@ -334,7 +315,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates some of the properties of a managed Cassandra cluster. @@ -363,13 +344,13 @@ public partial interface ICassandraClustersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ClusterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deletes a managed Cassandra cluster. /// /// - /// Invoke a command like nodetool for cassandra maintenance + /// Deletes a managed Cassandra cluster. /// /// /// The name of the resource group. The name is case insensitive. @@ -377,9 +358,6 @@ public partial interface ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// - /// - /// Specification which command to run where - /// /// /// The headers that will be added to request. /// @@ -389,10 +367,7 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginInvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deallocate the Managed Cassandra Cluster and Associated Data Centers. @@ -412,6 +387,10 @@ public partial interface ICassandraClustersOperations /// /// Managed Cassandra cluster name. /// + /// + /// Force to deallocate a cluster of Cluster Type Production. Force to + /// deallocate a cluster of Cluster Type Production might cause data loss + /// /// /// The headers that will be added to request. /// @@ -421,7 +400,36 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string xMsForceDeallocate = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Invoke a command like nodetool for cassandra maintenance + /// + /// + /// Invoke a command like nodetool for cassandra maintenance + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Managed Cassandra cluster name. + /// + /// + /// Specification which command to run where + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginInvokeCommandWithHttpMessagesAsync(string resourceGroupName, string clusterName, CommandPostBody body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Start the Managed Cassandra Cluster and Associated Data Centers. Start will @@ -450,7 +458,53 @@ public partial interface ICassandraClustersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List all managed Cassandra clusters in this subscription. + /// + /// + /// List all managed Cassandra clusters in this subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List all managed Cassandra clusters in this resource group. + /// + /// + /// List all managed Cassandra clusters in this resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraDataCentersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraDataCentersOperations.cs index 642f92257f97..b8317cdd6e76 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraDataCentersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraDataCentersOperations.cs @@ -37,7 +37,7 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get the properties of a managed Cassandra data center. @@ -68,32 +68,6 @@ public partial interface ICassandraDataCentersOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Delete a managed Cassandra data center. - /// - /// - /// Delete a managed Cassandra data center. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Managed Cassandra cluster name. - /// - /// - /// Data center name in a managed Cassandra cluster. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// /// Create or update a managed Cassandra data center. When updating, overwrite /// all properties. To update only some properties, use PATCH. @@ -126,7 +100,7 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update some of the properties of a managed Cassandra data center. @@ -158,7 +132,7 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete a managed Cassandra data center. @@ -184,7 +158,7 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create or update a managed Cassandra data center. When updating, overwrite @@ -218,7 +192,7 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update some of the properties of a managed Cassandra data center. @@ -250,7 +224,56 @@ public partial interface ICassandraDataCentersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Delete a managed Cassandra data center. + /// + /// + /// Delete a managed Cassandra data center. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Managed Cassandra cluster name. + /// + /// + /// Data center name in a managed Cassandra cluster. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string dataCenterName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List all data centers in a particular managed Cassandra cluster. + /// + /// + /// List all data centers in a particular managed Cassandra cluster. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraResourcesOperations.cs index 263f0d5ed283..e65342a853c3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICassandraResourcesOperations.cs @@ -39,7 +39,7 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListCassandraKeyspacesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListCassandraKeyspacesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the Cassandra keyspaces under an existing Azure Cosmos DB database @@ -131,12 +131,12 @@ public partial interface ICassandraResourcesOperations System.Threading.Tasks.Task> DeleteCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// - /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -159,13 +159,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListCassandraTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Gets the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Gets the Cassandra table under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -176,9 +178,8 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// Keyspace. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -192,15 +193,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB Cassandra Table /// /// /// The name of the resource group. The name is case insensitive. @@ -211,6 +210,12 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// + /// + /// The parameters to provide for the current Cassandra Table. + /// /// /// The headers that will be added to request. /// @@ -223,15 +228,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB Cassandra table. /// /// /// The name of the resource group. The name is case insensitive. @@ -242,6 +245,9 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The headers that will be added to request. /// @@ -251,18 +257,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Cosmos DB database account with the provided name. /// /// - /// Lists the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -273,6 +276,9 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// + /// + /// Cosmos DB table name. + /// /// /// The headers that will be added to request. /// @@ -285,15 +291,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListCassandraTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// - /// Gets the Cassandra table under an existing Azure Cosmos DB database - /// account. + /// Update RUs per second of an Azure Cosmos DB Cassandra table /// /// /// The name of the resource group. The name is case insensitive. @@ -307,6 +311,10 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB table name. /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// table. + /// /// /// The headers that will be added to request. /// @@ -319,13 +327,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -339,9 +349,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB table name. /// - /// - /// The parameters to provide for the current Cassandra Table. - /// /// /// The headers that will be added to request. /// @@ -354,13 +361,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput /// /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -383,14 +392,17 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure /// Cosmos DB database account with the provided name. /// /// - /// Gets the RUs per second of the Cassandra table under an existing Azure + /// Gets the RUs per second of the Cassandra Keyspace under an existing Azure /// Cosmos DB database account with the provided name. /// /// @@ -402,9 +414,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The headers that will be added to request. /// @@ -417,13 +426,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace /// /// /// The name of the resource group. The name is case insensitive. @@ -434,12 +443,9 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The RUs per second of the parameters to provide for the current Cassandra - /// table. + /// Keyspace. /// /// /// The headers that will be added to request. @@ -453,14 +459,14 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to /// autoscale /// /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to /// autoscale /// /// @@ -472,9 +478,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The headers that will be added to request. /// @@ -487,14 +490,14 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual /// throughput /// /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual /// throughput /// /// @@ -506,9 +509,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The headers that will be added to request. /// @@ -521,13 +521,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Cassandra keyspace + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. /// /// - /// Create or update an Azure Cosmos DB Cassandra keyspace + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. /// /// /// The name of the resource group. The name is case insensitive. @@ -535,12 +535,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// The parameters to provide for the current Cassandra keyspace. - /// /// /// The headers that will be added to request. /// @@ -553,13 +547,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListCassandraRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Assignment with the given Id. /// /// - /// Deletes an existing Azure Cosmos DB Cassandra keyspace. + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -567,8 +563,8 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -579,13 +575,16 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> GetCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. /// /// - /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -593,12 +592,11 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// Keyspace. + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -612,15 +610,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. /// /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -628,8 +624,31 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Assignment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. /// /// /// The headers that will be added to request. @@ -643,15 +662,15 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListCassandraRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Definition with the given Id. /// /// - /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual - /// throughput + /// Retrieves the properties of an existing Azure Cosmos DB Cassandra Role + /// Definition with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -659,8 +678,8 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -674,13 +693,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. /// /// - /// Create or update an Azure Cosmos DB Cassandra Table + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -688,14 +707,11 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// - /// - /// The parameters to provide for the current Cassandra Table. + /// + /// The properties required to create or update a Role Definition. /// /// /// The headers that will be added to request. @@ -709,13 +725,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. /// /// - /// Deletes an existing Azure Cosmos DB Cassandra table. + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -723,11 +739,8 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB keyspace name. - /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -738,13 +751,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// - /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// Create or update an Azure Cosmos DB Cassandra keyspace /// /// /// The name of the resource group. The name is case insensitive. @@ -755,12 +768,8 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// - /// - /// The RUs per second of the parameters to provide for the current Cassandra - /// table. + /// + /// The parameters to provide for the current Cassandra keyspace. /// /// /// The headers that will be added to request. @@ -774,15 +783,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// - /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Cassandra keyspace. /// /// /// The name of the resource group. The name is case insensitive. @@ -793,9 +800,6 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB keyspace name. /// - /// - /// Cosmos DB table name. - /// /// /// The headers that will be added to request. /// @@ -805,18 +809,13 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteCassandraKeyspaceWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual - /// throughput + /// Create or update an Azure Cosmos DB Cassandra Table /// /// - /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual - /// throughput + /// Create or update an Azure Cosmos DB Cassandra Table /// /// /// The name of the resource group. The name is case insensitive. @@ -830,6 +829,9 @@ public partial interface ICassandraResourcesOperations /// /// Cosmos DB table name. /// + /// + /// The parameters to provide for the current Cassandra Table. + /// /// /// The headers that will be added to request. /// @@ -842,7 +844,447 @@ public partial interface ICassandraResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB Cassandra table. + /// + /// + /// Deletes an existing Azure Cosmos DB Cassandra table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteCassandraTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra table + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// table. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateCassandraTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale + /// + /// + /// Migrate an Azure Cosmos DB Cassandra table from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table 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 + /// + System.Threading.Tasks.Task> BeginMigrateCassandraTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput + /// + /// + /// Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// Cosmos DB table 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 + /// + System.Threading.Tasks.Task> BeginMigrateCassandraTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// + /// + /// Update RUs per second of an Azure Cosmos DB Cassandra Keyspace + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace name. + /// + /// + /// The RUs per second of the parameters to provide for the current Cassandra + /// Keyspace. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateCassandraKeyspaceThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + /// autoscale + /// + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace 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 + /// + System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + /// throughput + /// + /// + /// Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB keyspace 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 + /// + System.Threading.Tasks.Task> BeginMigrateCassandraKeyspaceToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string keyspaceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateUpdateCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, CassandraRoleAssignmentResource createUpdateCassandraRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteCassandraRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Creates or updates an Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateUpdateCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, CassandraRoleDefinitionResource createUpdateCassandraRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// Deletes an existing Azure Cosmos DB Cassandra Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteCassandraRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + /// account. + /// + /// + /// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListCassandraKeyspacesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. + /// + /// + /// Lists the Cassandra table under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListCassandraTablesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListCassandraRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListCassandraRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionOperations.cs index d8ad8544de5b..597429db4e81 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionOperations.cs @@ -13,6 +13,38 @@ namespace Microsoft.Azure.Management.CosmosDB /// public partial interface ICollectionOperations { + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// Retrieves metric definitions for the given collection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + /// + /// Cosmos DB collection rid. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the metrics determined by the given filter for the given database /// account and collection. @@ -51,7 +83,7 @@ public partial interface ICollectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the usages (most recent storage data) for the given collection. @@ -88,7 +120,7 @@ public partial interface ICollectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves metric definitions for the given collection. @@ -96,17 +128,56 @@ public partial interface ICollectionOperations /// /// Retrieves metric definitions for the given collection. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database rid. + /// + /// The cancellation token. /// - /// - /// Cosmos DB collection rid. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and collection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the usages (most recent storage data) for the given collection. + /// + /// + /// Retrieves the usages (most recent storage data) for the given collection. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -120,7 +191,7 @@ public partial interface ICollectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionOperations.cs index a147b4f50600..4dd4beb4c738 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionOperations.cs @@ -51,7 +51,7 @@ public partial interface ICollectionPartitionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the usages (most recent storage data) for the given collection, @@ -90,7 +90,57 @@ public partial interface ICollectionPartitionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection, split by partition. + /// + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection, split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the usages (most recent storage data) for the given collection, + /// split by partition. + /// + /// + /// Retrieves the usages (most recent storage data) for the given collection, + /// split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionRegionOperations.cs index 2cdd9e53f1f3..9661a811ed44 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionPartitionRegionOperations.cs @@ -54,7 +54,32 @@ public partial interface ICollectionPartitionRegionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection and region, split by partition. + /// + /// + /// Retrieves the metrics determined by the given filter for the given + /// collection and region, split by partition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionRegionOperations.cs index e3088614a5ee..2fd8bb6b5823 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICollectionRegionOperations.cs @@ -54,7 +54,32 @@ public partial interface ICollectionRegionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account, collection and region. + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account, collection and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICosmosDBManagementClient.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICosmosDBManagementClient.cs index 5f9ef2e27776..8cfbeca236b6 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICosmosDBManagementClient.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ICosmosDBManagementClient.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB using Models; /// - /// Azure Cosmos DB Database Service Resource Provider REST API + /// Azure Cosmos DB Throughput Pool REST API /// public partial interface ICosmosDBManagementClient : System.IDisposable { @@ -36,9 +36,15 @@ public partial interface ICosmosDBManagementClient : System.IDisposable /// - /// The ID of the target subscription. + /// The API version to use for this operation. /// - string SubscriptionId { get; set;} + string ApiVersion { get;} + + + /// + /// The ID of the target subscription. The value must be an UUID. + /// + System.Guid SubscriptionId { get; set;} /// @@ -73,184 +79,189 @@ public partial interface ICosmosDBManagementClient : System.IDisposable IOperations Operations { get; } /// - /// Gets the IDatabaseOperations + /// Gets the ICassandraClustersOperations /// - IDatabaseOperations Database { get; } + ICassandraClustersOperations CassandraClusters { get; } /// - /// Gets the ICollectionOperations + /// Gets the IFleetOperations /// - ICollectionOperations Collection { get; } + IFleetOperations Fleet { get; } /// - /// Gets the ICollectionRegionOperations + /// Gets the ILocationsOperations /// - ICollectionRegionOperations CollectionRegion { get; } + ILocationsOperations Locations { get; } /// - /// Gets the IDatabaseAccountRegionOperations + /// Gets the IRestorableDatabaseAccountsOperations /// - IDatabaseAccountRegionOperations DatabaseAccountRegion { get; } + IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; } /// - /// Gets the IPercentileSourceTargetOperations + /// Gets the IRestorableGremlinGraphsOperations /// - IPercentileSourceTargetOperations PercentileSourceTarget { get; } + IRestorableGremlinGraphsOperations RestorableGremlinGraphs { get; } /// - /// Gets the IPercentileTargetOperations + /// Gets the IRestorableGremlinDatabasesOperations /// - IPercentileTargetOperations PercentileTarget { get; } + IRestorableGremlinDatabasesOperations RestorableGremlinDatabases { get; } /// - /// Gets the IPercentileOperations + /// Gets the IRestorableGremlinResourcesOperations /// - IPercentileOperations Percentile { get; } + IRestorableGremlinResourcesOperations RestorableGremlinResources { get; } /// - /// Gets the ICollectionPartitionRegionOperations + /// Gets the IRestorableMongodbCollectionsOperations /// - ICollectionPartitionRegionOperations CollectionPartitionRegion { get; } + IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; } /// - /// Gets the ICollectionPartitionOperations + /// Gets the IRestorableMongodbDatabasesOperations /// - ICollectionPartitionOperations CollectionPartition { get; } + IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; } /// - /// Gets the IPartitionKeyRangeIdOperations + /// Gets the IRestorableMongodbResourcesOperations /// - IPartitionKeyRangeIdOperations PartitionKeyRangeId { get; } + IRestorableMongodbResourcesOperations RestorableMongodbResources { get; } /// - /// Gets the IPartitionKeyRangeIdRegionOperations + /// Gets the IRestorableSqlContainersOperations /// - IPartitionKeyRangeIdRegionOperations PartitionKeyRangeIdRegion { get; } + IRestorableSqlContainersOperations RestorableSqlContainers { get; } /// - /// Gets the ISqlResourcesOperations + /// Gets the IRestorableSqlDatabasesOperations /// - ISqlResourcesOperations SqlResources { get; } + IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; } /// - /// Gets the IMongoDbResourcesOperations + /// Gets the IRestorableSqlResourcesOperations /// - IMongoDbResourcesOperations MongoDbResources { get; } + IRestorableSqlResourcesOperations RestorableSqlResources { get; } /// - /// Gets the ITableResourcesOperations + /// Gets the IRestorableTableResourcesOperations /// - ITableResourcesOperations TableResources { get; } + IRestorableTableResourcesOperations RestorableTableResources { get; } /// - /// Gets the ICassandraResourcesOperations + /// Gets the IRestorableTablesOperations /// - ICassandraResourcesOperations CassandraResources { get; } + IRestorableTablesOperations RestorableTables { get; } /// - /// Gets the IGremlinResourcesOperations + /// Gets the ICassandraDataCentersOperations /// - IGremlinResourcesOperations GremlinResources { get; } + ICassandraDataCentersOperations CassandraDataCenters { get; } /// - /// Gets the ILocationsOperations + /// Gets the ICassandraResourcesOperations /// - ILocationsOperations Locations { get; } + ICassandraResourcesOperations CassandraResources { get; } /// - /// Gets the ICassandraClustersOperations + /// Gets the ICollectionOperations /// - ICassandraClustersOperations CassandraClusters { get; } + ICollectionOperations Collection { get; } /// - /// Gets the ICassandraDataCentersOperations + /// Gets the IPartitionKeyRangeIdOperations /// - ICassandraDataCentersOperations CassandraDataCenters { get; } + IPartitionKeyRangeIdOperations PartitionKeyRangeId { get; } /// - /// Gets the INotebookWorkspacesOperations + /// Gets the ICollectionPartitionOperations /// - INotebookWorkspacesOperations NotebookWorkspaces { get; } + ICollectionPartitionOperations CollectionPartition { get; } /// - /// Gets the IPrivateEndpointConnectionsOperations + /// Gets the IDatabaseOperations /// - IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } + IDatabaseOperations Database { get; } /// - /// Gets the IPrivateLinkResourcesOperations + /// Gets the IGremlinResourcesOperations /// - IPrivateLinkResourcesOperations PrivateLinkResources { get; } + IGremlinResourcesOperations GremlinResources { get; } /// - /// Gets the IRestorableDatabaseAccountsOperations + /// Gets the IMongoMiResourcesOperations /// - IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; } + IMongoMiResourcesOperations MongoMiResources { get; } /// - /// Gets the IRestorableSqlDatabasesOperations + /// Gets the IMongoDbResourcesOperations /// - IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; } + IMongoDbResourcesOperations MongoDbResources { get; } /// - /// Gets the IRestorableSqlContainersOperations + /// Gets the INotebookWorkspacesOperations /// - IRestorableSqlContainersOperations RestorableSqlContainers { get; } + INotebookWorkspacesOperations NotebookWorkspaces { get; } /// - /// Gets the IRestorableSqlResourcesOperations + /// Gets the IPercentileOperations /// - IRestorableSqlResourcesOperations RestorableSqlResources { get; } + IPercentileOperations Percentile { get; } /// - /// Gets the IRestorableMongodbDatabasesOperations + /// Gets the IPrivateEndpointConnectionsOperations /// - IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; } + IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; } /// - /// Gets the IRestorableMongodbCollectionsOperations + /// Gets the IPrivateLinkResourcesOperations /// - IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; } + IPrivateLinkResourcesOperations PrivateLinkResources { get; } /// - /// Gets the IRestorableMongodbResourcesOperations + /// Gets the ICollectionRegionOperations /// - IRestorableMongodbResourcesOperations RestorableMongodbResources { get; } + ICollectionRegionOperations CollectionRegion { get; } /// - /// Gets the IRestorableGremlinDatabasesOperations + /// Gets the IPartitionKeyRangeIdRegionOperations /// - IRestorableGremlinDatabasesOperations RestorableGremlinDatabases { get; } + IPartitionKeyRangeIdRegionOperations PartitionKeyRangeIdRegion { get; } /// - /// Gets the IRestorableGremlinGraphsOperations + /// Gets the ICollectionPartitionRegionOperations /// - IRestorableGremlinGraphsOperations RestorableGremlinGraphs { get; } + ICollectionPartitionRegionOperations CollectionPartitionRegion { get; } /// - /// Gets the IRestorableGremlinResourcesOperations + /// Gets the IDatabaseAccountRegionOperations /// - IRestorableGremlinResourcesOperations RestorableGremlinResources { get; } + IDatabaseAccountRegionOperations DatabaseAccountRegion { get; } /// - /// Gets the IRestorableTablesOperations + /// Gets the IServiceOperations /// - IRestorableTablesOperations RestorableTables { get; } + IServiceOperations Service { get; } /// - /// Gets the IRestorableTableResourcesOperations + /// Gets the IPercentileSourceTargetOperations /// - IRestorableTableResourcesOperations RestorableTableResources { get; } + IPercentileSourceTargetOperations PercentileSourceTarget { get; } /// - /// Gets the IServiceOperations + /// Gets the ISqlResourcesOperations /// - IServiceOperations Service { get; } + ISqlResourcesOperations SqlResources { get; } /// - /// Gets the IFleetOperations + /// Gets the ITableResourcesOperations /// - IFleetOperations Fleet { get; } + ITableResourcesOperations TableResources { get; } + + /// + /// Gets the IPercentileTargetOperations + /// + IPercentileTargetOperations PercentileTarget { get; } /// /// Gets the IFleetspaceOperations diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountRegionOperations.cs index da1fd39f4011..81e869532fba 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountRegionOperations.cs @@ -48,7 +48,32 @@ public partial interface IDatabaseAccountRegionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and region. + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountsOperations.cs index c5a729d67416..458b7d02b783 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseAccountsOperations.cs @@ -13,6 +13,77 @@ namespace Microsoft.Azure.Management.CosmosDB /// public partial interface IDatabaseAccountsOperations { + /// + /// Checks that the Azure Cosmos DB account name already exists. A valid + /// account name may contain only lowercase letters, numbers, and the '-' + /// character, and must be between 3 and 50 characters. + /// + /// + /// Checks that the Azure Cosmos DB account name already exists. A valid + /// account name may contain only lowercase letters, numbers, and the '-' + /// character, and must be between 3 and 50 characters. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CheckNameExistsWithHttpMessagesAsync(string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the properties of an existing Azure Cosmos DB database account. /// @@ -40,10 +111,12 @@ public partial interface IDatabaseAccountsOperations System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Updates the properties of an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// - /// Updates the properties of an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The name of the resource group. The name is case insensitive. @@ -51,7 +124,7 @@ public partial interface IDatabaseAccountsOperations /// /// Cosmos DB database account name. /// - /// + /// /// The parameters to provide for the current database account. /// /// @@ -66,15 +139,13 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. + /// Updates the properties of an existing Azure Cosmos DB database account. /// /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. + /// Updates the properties of an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -82,7 +153,7 @@ public partial interface IDatabaseAccountsOperations /// /// Cosmos DB database account name. /// - /// + /// /// The parameters to provide for the current database account. /// /// @@ -97,7 +168,7 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB database account. @@ -157,13 +228,19 @@ public partial interface IDatabaseAccountsOperations System.Threading.Tasks.Task> FailoverPriorityChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, FailoverPolicies failoverParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists all the Azure Cosmos DB database accounts available under the - /// subscription. + /// Lists the connection strings for the specified Azure Cosmos DB database + /// account. /// /// - /// Lists all the Azure Cosmos DB database accounts available under the - /// subscription. + /// Lists the connection strings for the specified Azure Cosmos DB database + /// 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. /// @@ -176,19 +253,20 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists all the Azure Cosmos DB database accounts available under the given - /// resource group. + /// Lists the access keys for the specified Azure Cosmos DB database account. /// /// - /// Lists all the Azure Cosmos DB database accounts available under the given - /// resource group. + /// Lists the access keys for the specified Azure Cosmos DB database 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. /// @@ -201,13 +279,13 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the access keys for the specified Azure Cosmos DB database account. + /// Retrieves metric definitions for the given database account. /// /// - /// Lists the access keys for the specified Azure Cosmos DB database account. + /// Retrieves metric definitions for the given database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -227,14 +305,14 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> ListKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the connection strings for the specified Azure Cosmos DB database + /// Retrieves the metrics determined by the given filter for the given database /// account. /// /// - /// Lists the connection strings for the specified Azure Cosmos DB database + /// Retrieves the metrics determined by the given filter for the given database /// account. /// /// @@ -243,6 +321,12 @@ public partial interface IDatabaseAccountsOperations /// /// Cosmos DB database account name. /// + /// + /// An OData filter expression that describes a subset of metrics to return. + /// The parameters that can be filtered are name.value (name of the metric, can + /// have an or of multiple names), startTime, endTime, and timeGrain. The + /// supported operator is eq. + /// /// /// The headers that will be added to request. /// @@ -255,7 +339,7 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> ListConnectionStringsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Offline the specified region for the specified Azure Cosmos DB database @@ -397,64 +481,6 @@ public partial interface IDatabaseAccountsOperations /// System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountRegenerateKeyParameters keyToRegenerate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Checks that the Azure Cosmos DB account name already exists. A valid - /// account name may contain only lowercase letters, numbers, and the '-' - /// character, and must be between 3 and 50 characters. - /// - /// - /// Checks that the Azure Cosmos DB account name already exists. A valid - /// account name may contain only lowercase letters, numbers, and the '-' - /// character, and must be between 3 and 50 characters. - /// - /// - /// 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 - /// - System.Threading.Tasks.Task> CheckNameExistsWithHttpMessagesAsync(string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Retrieves the metrics determined by the given filter for the given database - /// account. - /// - /// - /// Retrieves the metrics determined by the given filter for the given database - /// account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// An OData filter expression that describes a subset of metrics to return. - /// The parameters that can be filtered are name.value (name of the metric, can - /// have an or of multiple names), startTime, endTime, and timeGrain. The - /// supported operator is eq. - /// - /// - /// 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 - /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// /// Retrieves the usages (most recent data) for the given database account. /// @@ -484,13 +510,15 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves metric definitions for the given database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// - /// Retrieves metric definitions for the given database account. + /// Creates or updates an Azure Cosmos DB database account. The "Update" method + /// is preferred when performing updates on an account. /// /// /// The name of the resource group. The name is case insensitive. @@ -498,6 +526,9 @@ public partial interface IDatabaseAccountsOperations /// /// Cosmos DB database account name. /// + /// + /// The parameters to provide for the current database account. + /// /// /// The headers that will be added to request. /// @@ -510,7 +541,7 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates the properties of an existing Azure Cosmos DB database account. @@ -539,38 +570,7 @@ public partial interface IDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. - /// - /// - /// Creates or updates an Azure Cosmos DB database account. The "Update" method - /// is preferred when performing updates on an account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The parameters to provide for the current database account. - /// - /// - /// 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 - /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountUpdateParameters updateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB database account. @@ -713,5 +713,126 @@ public partial interface IDatabaseAccountsOperations /// System.Threading.Tasks.Task> BeginRegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, DatabaseAccountRegenerateKeyParameters keyToRegenerate, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// Lists all the Azure Cosmos DB database accounts available under the + /// subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// Lists all the Azure Cosmos DB database accounts available under the given + /// resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves metric definitions for the given database account. + /// + /// + /// Retrieves metric definitions for the given database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the usages (most recent data) for the given database account. + /// + /// + /// Retrieves the usages (most recent data) for the given database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseOperations.cs index ebaa2326dab1..b9c67e36abe7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IDatabaseOperations.cs @@ -13,6 +13,35 @@ namespace Microsoft.Azure.Management.CosmosDB /// public partial interface IDatabaseOperations { + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// Retrieves metric definitions for the given database. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database rid. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Retrieves the metrics determined by the given filter for the given database /// account and database. @@ -48,7 +77,7 @@ public partial interface IDatabaseOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the usages (most recent data) for the given database. @@ -82,7 +111,7 @@ public partial interface IDatabaseOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves metric definitions for the given database. @@ -90,14 +119,56 @@ public partial interface IDatabaseOperations /// /// Retrieves metric definitions for the given database. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database rid. + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListMetricDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account and database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the usages (most recent data) for the given database. + /// + /// + /// Retrieves the usages (most recent data) for the given database. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -111,7 +182,7 @@ public partial interface IDatabaseOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListUsagesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceAccountOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceAccountOperations.cs index 574778e8aa2f..a1a70d6a46cb 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceAccountOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceAccountOperations.cs @@ -109,7 +109,7 @@ public partial interface IFleetspaceAccountOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. @@ -173,7 +173,7 @@ public partial interface IFleetspaceAccountOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, string fleetspaceAccountName, FleetspaceAccountResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Removes an existing Azure Cosmos DB fleetspace account from a fleetspace. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceOperations.cs index 61623d3bd081..3809c469fb86 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IFleetspaceOperations.cs @@ -100,7 +100,7 @@ public partial interface IFleetspaceOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update the properties of an existing Azure Cosmos DB fleetspace under a @@ -192,7 +192,7 @@ public partial interface IFleetspaceOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceResource body, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update the properties of an existing Azure Cosmos DB fleetspace under a diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IGremlinResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IGremlinResourcesOperations.cs index c371ce7823dd..8b2584e1a221 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IGremlinResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IGremlinResourcesOperations.cs @@ -39,7 +39,7 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListGremlinDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListGremlinDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the Gremlin databases under an existing Azure Cosmos DB database @@ -130,13 +130,463 @@ public partial interface IGremlinResourcesOperations /// System.Threading.Tasks.Task> DeleteGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 + /// + System.Threading.Tasks.Task>> ListGremlinGraphsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph 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 + /// + System.Threading.Tasks.Task> GetGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update an Azure Cosmos DB Gremlin graph + /// + /// + /// Create or update an Azure Cosmos DB Gremlin graph + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The parameters to provide for the current Gremlin graph. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// + /// + /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves continuous backup information for a gremlin graph. + /// + /// + /// Retrieves continuous backup information for a gremlin graph. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The name of the continuous backup restore location. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB + /// database account with the provided name. + /// + /// + /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB + /// database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph 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 + /// + System.Threading.Tasks.Task> GetGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph name. + /// + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// graph. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale + /// + /// + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph 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 + /// + System.Threading.Tasks.Task> MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput + /// + /// + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB graph 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 + /// + System.Threading.Tasks.Task> MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Gets the RUs per second of the Gremlin database under an existing Azure /// Cosmos DB database account with the provided name. /// /// - /// Gets the RUs per second of the Gremlin database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Gets the RUs per second of the Gremlin database under an existing Azure + /// Cosmos DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 + /// + System.Threading.Tasks.Task> GetGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// + /// + /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// database. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale + /// + /// + /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 + /// + System.Threading.Tasks.Task> MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput + /// + /// + /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 + /// + System.Threading.Tasks.Task> MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListGremlinRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Assignment with the given Id. + /// + /// + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -144,8 +594,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -159,13 +609,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// - /// Update RUs per second of an Azure Cosmos DB Gremlin database + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -173,12 +623,11 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// database. + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -192,15 +641,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateGremlinDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. /// /// - /// Migrate an Azure Cosmos DB Gremlin database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -208,8 +655,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -220,18 +667,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateGremlinDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. /// /// - /// Migrate an Azure Cosmos DB Gremlin database from autoscale to manual - /// throughput + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. /// /// /// The name of the resource group. The name is case insensitive. @@ -239,9 +681,6 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// /// /// The headers that will be added to request. /// @@ -254,13 +693,15 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListGremlinRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Definition with the given Id. /// /// - /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. + /// Retrieves the properties of an existing Azure Cosmos DB Gremlin Role + /// Definition with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -268,8 +709,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -283,13 +724,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListGremlinGraphsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. /// /// - /// Gets the Gremlin graph under an existing Azure Cosmos DB database account. + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -297,11 +738,11 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// - /// - /// Cosmos DB graph name. + /// + /// The properties required to create or update a Role Definition. /// /// /// The headers that will be added to request. @@ -315,13 +756,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. /// /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -329,14 +770,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. - /// - /// - /// The parameters to provide for the current Gremlin graph. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -347,16 +782,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> CreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Create or update an Azure Cosmos DB Gremlin database /// /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Create or update an Azure Cosmos DB Gremlin database /// /// /// The name of the resource group. The name is case insensitive. @@ -367,8 +799,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. + /// + /// The parameters to provide for the current Gremlin database. /// /// /// The headers that will be added to request. @@ -379,15 +811,16 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB - /// database account with the provided name. + /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// - /// Gets the Gremlin graph throughput under an existing Azure Cosmos DB - /// database account with the provided name. + /// Deletes an existing Azure Cosmos DB Gremlin database. /// /// /// The name of the resource group. The name is case insensitive. @@ -398,9 +831,6 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB graph name. - /// /// /// The headers that will be added to request. /// @@ -410,16 +840,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> GetGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Create or update an Azure Cosmos DB Gremlin graph /// /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Create or update an Azure Cosmos DB Gremlin graph /// /// /// The name of the resource group. The name is case insensitive. @@ -433,9 +860,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB graph name. /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// graph. + /// + /// The parameters to provide for the current Gremlin graph. /// /// /// The headers that will be added to request. @@ -449,15 +875,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin graph. /// /// /// The name of the resource group. The name is case insensitive. @@ -480,18 +904,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a gremlin graph. /// /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a gremlin graph. /// /// /// The name of the resource group. The name is case insensitive. @@ -505,6 +924,9 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB graph name. /// + /// + /// The name of the continuous backup restore location. + /// /// /// The headers that will be added to request. /// @@ -517,13 +939,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a gremlin graph. + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// - /// Retrieves continuous backup information for a gremlin graph. + /// Update RUs per second of an Azure Cosmos DB Gremlin graph /// /// /// The name of the resource group. The name is case insensitive. @@ -537,8 +959,9 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB graph name. /// - /// - /// The name of the continuous backup restore location. + /// + /// The RUs per second of the parameters to provide for the current Gremlin + /// graph. /// /// /// The headers that will be added to request. @@ -552,13 +975,15 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Gremlin database + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// - /// Create or update an Azure Cosmos DB Gremlin database + /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -569,8 +994,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the current Gremlin database. + /// + /// Cosmos DB graph name. /// /// /// The headers that will be added to request. @@ -584,13 +1009,15 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Gremlin database. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// - /// Deletes an existing Azure Cosmos DB Gremlin database. + /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -601,6 +1028,9 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB graph name. + /// /// /// The headers that will be added to request. /// @@ -610,7 +1040,10 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteGremlinDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update RUs per second of an Azure Cosmos DB Gremlin database @@ -708,10 +1141,10 @@ public partial interface IGremlinResourcesOperations System.Threading.Tasks.Task> BeginMigrateGremlinDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// - /// Create or update an Azure Cosmos DB Gremlin graph + /// Creates or updates an Azure Cosmos DB Gremlin Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -719,14 +1152,11 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The parameters to provide for the current Gremlin graph. + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -740,13 +1170,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, GremlinRoleAssignmentResource createUpdateGremlinRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. /// /// - /// Deletes an existing Azure Cosmos DB Gremlin graph. + /// Deletes an existing Azure Cosmos DB Gremlin Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -754,11 +1184,8 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -769,13 +1196,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteGremlinGraphWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteGremlinRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. /// /// - /// Update RUs per second of an Azure Cosmos DB Gremlin graph + /// Creates or updates an Azure Cosmos DB Gremlin Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -783,15 +1210,11 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. + /// + /// The GUID for the Role Definition. /// - /// - /// The RUs per second of the parameters to provide for the current Gremlin - /// graph. + /// + /// The properties required to create or update a Role Definition. /// /// /// The headers that will be added to request. @@ -805,15 +1228,13 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateGremlinGraphThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, GremlinRoleDefinitionResource createUpdateGremlinRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. /// /// - /// Migrate an Azure Cosmos DB Gremlin graph from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB Gremlin Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -821,11 +1242,30 @@ public partial interface IGremlinResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// - /// - /// Cosmos DB graph name. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteGremlinRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the Gremlin databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// Lists the Gremlin databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -839,27 +1279,16 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateGremlinGraphToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListGremlinDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// /// - /// Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual - /// throughput + /// Lists the Gremlin graph under an existing Azure Cosmos DB database account. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB graph name. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -873,28 +1302,39 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateGremlinGraphToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListGremlinGraphsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a gremlin graph. + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. /// /// - /// Retrieves continuous backup information for a gremlin graph. + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB graph name. + /// + /// The cancellation token. /// - /// - /// The name of the continuous backup restore location. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListGremlinRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -908,7 +1348,7 @@ public partial interface IGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string graphName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListGremlinRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ILocationsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ILocationsOperations.cs index c61ed0d3580c..f351c02c79a6 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ILocationsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ILocationsOperations.cs @@ -31,7 +31,7 @@ public partial interface ILocationsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get the properties of an existing Cosmos DB location @@ -56,5 +56,28 @@ public partial interface ILocationsOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// List Cosmos DB locations and their properties + /// + /// + /// List Cosmos DB locations and their properties + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoDBResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoDBResourcesOperations.cs index fc6ce5b5efce..cbc0e2f3093c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoDBResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoDBResourcesOperations.cs @@ -39,7 +39,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMongoDBDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMongoDBDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the MongoDB databases under an existing Azure Cosmos DB database @@ -131,12 +131,12 @@ public partial interface IMongoDbResourcesOperations System.Threading.Tasks.Task> DeleteMongoDBDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the MongoDB database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// - /// Gets the RUs per second of the MongoDB database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -159,13 +159,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMongoDBCollectionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Gets the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Gets the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -176,9 +178,8 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The RUs per second of the parameters to provide for the current MongoDB - /// database. + /// + /// Cosmos DB collection name. /// /// /// The headers that will be added to request. @@ -192,15 +193,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The name of the resource group. The name is case insensitive. @@ -211,6 +210,12 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// + /// + /// The parameters to provide for the current MongoDB Collection. + /// /// /// The headers that will be added to request. /// @@ -223,15 +228,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -242,6 +245,9 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The headers that will be added to request. /// @@ -251,18 +257,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Retrieves continuous backup information for a Mongodb collection. /// /// - /// Lists the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -273,6 +274,12 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// + /// + /// The name of the continuous backup restore location. + /// /// /// The headers that will be added to request. /// @@ -285,15 +292,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMongoDBCollectionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the MongoDB collection under an existing Azure + /// Cosmos DB database account with the provided name. /// /// - /// Gets the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the MongoDB collection under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -319,13 +326,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The name of the resource group. The name is case insensitive. @@ -339,8 +346,9 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB collection name. /// - /// - /// The parameters to provide for the current MongoDB Collection. + /// + /// The RUs per second of the parameters to provide for the current MongoDB + /// collection. /// /// /// The headers that will be added to request. @@ -354,13 +362,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -383,15 +393,18 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the MongoDB collection under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// - /// Gets the RUs per second of the MongoDB collection under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -417,13 +430,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Gets the RUs per second of the MongoDB database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Gets the RUs per second of the MongoDB database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -434,12 +449,38 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection 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 + /// + System.Threading.Tasks.Task> GetMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// + /// + /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. /// /// /// The RUs per second of the parameters to provide for the current MongoDB - /// collection. + /// database. /// /// /// The headers that will be added to request. @@ -453,14 +494,14 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// @@ -472,9 +513,6 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The headers that will be added to request. /// @@ -487,14 +525,14 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// @@ -506,8 +544,31 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection 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 + /// + System.Threading.Tasks.Task> MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. /// /// /// The headers that will be added to request. @@ -521,7 +582,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMongoRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role @@ -531,15 +592,15 @@ public partial interface IMongoDbResourcesOperations /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role /// Definition with the given Id. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The headers that will be added to request. /// @@ -552,7 +613,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates an Azure Cosmos DB Mongo Role Definition. @@ -560,15 +621,15 @@ public partial interface IMongoDbResourcesOperations /// /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The properties required to create or update a Role Definition. /// @@ -584,7 +645,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB Mongo Role Definition. @@ -592,15 +653,15 @@ public partial interface IMongoDbResourcesOperations /// /// Deletes an existing Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The headers that will be added to request. /// @@ -610,13 +671,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. /// /// - /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -636,7 +697,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMongoRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMongoUserDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the properties of an existing Azure Cosmos DB Mongo User @@ -646,15 +707,15 @@ public partial interface IMongoDbResourcesOperations /// Retrieves the properties of an existing Azure Cosmos DB Mongo User /// Definition with the given Id. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The headers that will be added to request. /// @@ -667,7 +728,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates an Azure Cosmos DB Mongo User Definition. @@ -675,15 +736,15 @@ public partial interface IMongoDbResourcesOperations /// /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The properties required to create or update a User Definition. /// @@ -699,7 +760,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB Mongo User Definition. @@ -707,15 +768,15 @@ public partial interface IMongoDbResourcesOperations /// /// Deletes an existing Azure Cosmos DB Mongo User Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The headers that will be added to request. /// @@ -725,13 +786,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// Create or updates Azure Cosmos DB MongoDB database /// /// - /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// Create or updates Azure Cosmos DB MongoDB database /// /// /// The name of the resource group. The name is case insensitive. @@ -739,6 +800,12 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// + /// + /// The parameters to provide for the current MongoDB database. + /// /// /// The headers that will be added to request. /// @@ -751,13 +818,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMongoUserDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateMongoDBDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Deletes an existing Azure Cosmos DB MongoDB database. /// /// /// The name of the resource group. The name is case insensitive. @@ -768,12 +835,6 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - /// - /// The name of the continuous backup restore location. - /// /// /// The headers that will be added to request. /// @@ -783,16 +844,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteMongoDBDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or updates Azure Cosmos DB MongoDB database + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// - /// Create or updates Azure Cosmos DB MongoDB database + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The name of the resource group. The name is case insensitive. @@ -803,8 +861,11 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the current MongoDB database. + /// + /// Cosmos DB collection name. + /// + /// + /// The parameters to provide for the current MongoDB Collection. /// /// /// The headers that will be added to request. @@ -818,13 +879,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateMongoDBDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB MongoDB database. + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// - /// Deletes an existing Azure Cosmos DB MongoDB database. + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -835,6 +896,9 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The headers that will be added to request. /// @@ -844,13 +908,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteMongoDBDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Retrieves continuous backup information for a Mongodb collection. /// /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -861,9 +925,11 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The RUs per second of the parameters to provide for the current MongoDB - /// database. + /// + /// Cosmos DB collection name. + /// + /// + /// The name of the continuous backup restore location. /// /// /// The headers that will be added to request. @@ -877,15 +943,13 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The name of the resource group. The name is case insensitive. @@ -896,36 +960,12 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database 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 - /// - System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput - /// - /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. + /// + /// Cosmos DB collection name. /// - /// - /// Cosmos DB database name. + /// + /// The RUs per second of the parameters to provide for the current MongoDB + /// collection. /// /// /// The headers that will be added to request. @@ -939,13 +979,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -959,9 +1001,6 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB collection name. /// - /// - /// The parameters to provide for the current MongoDB Collection. - /// /// /// The headers that will be added to request. /// @@ -974,13 +1013,15 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1003,13 +1044,16 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The name of the resource group. The name is case insensitive. @@ -1020,12 +1064,9 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The RUs per second of the parameters to provide for the current MongoDB - /// collection. + /// database. /// /// /// The headers that will be added to request. @@ -1039,14 +1080,14 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// @@ -1058,9 +1099,6 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The headers that will be added to request. /// @@ -1073,14 +1111,14 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// @@ -1092,9 +1130,6 @@ public partial interface IMongoDbResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The headers that will be added to request. /// @@ -1107,7 +1142,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates an Azure Cosmos DB Mongo Role Definition. @@ -1115,15 +1150,15 @@ public partial interface IMongoDbResourcesOperations /// /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The properties required to create or update a Role Definition. /// @@ -1139,7 +1174,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB Mongo Role Definition. @@ -1147,15 +1182,15 @@ public partial interface IMongoDbResourcesOperations /// /// Deletes an existing Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The headers that will be added to request. /// @@ -1165,7 +1200,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates an Azure Cosmos DB Mongo User Definition. @@ -1173,15 +1208,15 @@ public partial interface IMongoDbResourcesOperations /// /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The properties required to create or update a User Definition. /// @@ -1197,7 +1232,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB Mongo User Definition. @@ -1205,15 +1240,15 @@ public partial interface IMongoDbResourcesOperations /// /// Deletes an existing Azure Cosmos DB Mongo User Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The headers that will be added to request. /// @@ -1223,28 +1258,89 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Lists the MongoDB databases under an existing Azure Cosmos DB database + /// account. /// /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Lists the MongoDB databases under an existing Azure Cosmos DB database + /// account. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database name. + /// + /// The cancellation token. /// - /// - /// Cosmos DB collection name. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListMongoDBDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. + /// + /// + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The name of the continuous backup restore location. + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoDBCollectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1258,7 +1354,7 @@ public partial interface IMongoDbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMongoUserDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoMIResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoMIResourcesOperations.cs new file mode 100644 index 000000000000..1874067e2c78 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IMongoMIResourcesOperations.cs @@ -0,0 +1,409 @@ +// 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.Azure; + using Models; + + /// + /// MongoMiResourcesOperations operations. + /// + public partial interface IMongoMiResourcesOperations + { + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoMIRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Assignment with the given Id. + /// + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Assignment with the given Id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoMIRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Definition with the given Id. + /// + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Definition with the given Id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoMIRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMongoMIRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/INotebookWorkspacesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/INotebookWorkspacesOperations.cs index 94225ac64ba6..dd3e3f21416f 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/INotebookWorkspacesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/INotebookWorkspacesOperations.cs @@ -37,7 +37,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the notebook workspace for a Cosmos DB account. @@ -92,7 +92,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes the notebook workspace for a Cosmos DB account. @@ -115,7 +115,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves the connection info for the notebook workspace @@ -164,7 +164,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Starts the notebook workspace @@ -187,7 +187,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates the notebook workspace for a Cosmos DB account. @@ -216,7 +216,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes the notebook workspace for a Cosmos DB account. @@ -239,7 +239,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Regenerates the auth token for the notebook workspace @@ -262,7 +262,7 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Starts the notebook workspace @@ -285,7 +285,30 @@ public partial interface INotebookWorkspacesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdOperations.cs index fac03147bf02..b50c62489bad 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdOperations.cs @@ -54,7 +54,32 @@ public partial interface IPartitionKeyRangeIdOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id. + /// + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdRegionOperations.cs index a690846841fc..8e615eb4bac9 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPartitionKeyRangeIdRegionOperations.cs @@ -57,7 +57,32 @@ public partial interface IPartitionKeyRangeIdRegionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id and region. + /// + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileOperations.cs index 95d6fcb40338..3e92431357a4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileOperations.cs @@ -45,7 +45,32 @@ public partial interface IPercentileOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. This url is only for PBS and Replication Latency data + /// + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. This url is only for PBS and Replication Latency data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileSourceTargetOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileSourceTargetOperations.cs index 0e840b689ca5..c23d5ea0e868 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileSourceTargetOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileSourceTargetOperations.cs @@ -55,7 +55,34 @@ public partial interface IPercentileSourceTargetOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given account, + /// source and target region. This url is only for PBS and Replication Latency + /// data + /// + /// + /// Retrieves the metrics determined by the given filter for the given account, + /// source and target region. This url is only for PBS and Replication Latency + /// data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileTargetOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileTargetOperations.cs index e329f21e4402..08f6c54681be 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileTargetOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPercentileTargetOperations.cs @@ -49,7 +49,32 @@ public partial interface IPercentileTargetOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the metrics determined by the given filter for the given account + /// target region. This url is only for PBS and Replication Latency data + /// + /// + /// Retrieves the metrics determined by the given filter for the given account + /// target region. This url is only for PBS and Replication Latency data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs index 4e835352d21b..12734a5c7ab5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateEndpointConnectionsOperations.cs @@ -37,7 +37,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets a private endpoint connection. @@ -98,7 +98,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a private endpoint connection with a given name. @@ -124,7 +124,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Approve or reject a private endpoint connection with a given name. @@ -156,7 +156,7 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes a private endpoint connection with a given name. @@ -182,7 +182,30 @@ public partial interface IPrivateEndpointConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List all private endpoint connections on a Cosmos DB account. + /// + /// + /// List all private endpoint connections on a Cosmos DB account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs index 8ef5c5f28ac7..18faca90107c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IPrivateLinkResourcesOperations.cs @@ -39,7 +39,7 @@ public partial interface IPrivateLinkResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the private link resources that need to be created for a Cosmos DB @@ -72,5 +72,30 @@ public partial interface IPrivateLinkResourcesOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string groupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets the private link resources that need to be created for a Cosmos DB + /// account. + /// + /// + /// Gets the private link resources that need to be created for a Cosmos DB + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableDatabaseAccountsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableDatabaseAccountsOperations.cs index 32004e3fa7ed..234ab98c2513 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableDatabaseAccountsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableDatabaseAccountsOperations.cs @@ -40,7 +40,39 @@ public partial interface IRestorableDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the properties of an existing Azure Cosmos DB restorable database + /// account. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// permission. + /// + /// + /// Retrieves the properties of an existing Azure Cosmos DB restorable database + /// account. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// permission. + /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// + /// The instanceId GUID of a restorable database account. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists all the restorable Azure Cosmos DB database accounts available under @@ -66,25 +98,51 @@ public partial interface IRestorableDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the properties of an existing Azure Cosmos DB restorable database - /// account. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription and in a region. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' /// permission. /// /// - /// Retrieves the properties of an existing Azure Cosmos DB restorable database - /// account. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription and in a region. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' /// permission. /// - /// - /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The instanceId GUID of a restorable database account. + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -98,7 +156,7 @@ public partial interface IRestorableDatabaseAccountsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinDatabasesOperations.cs index d7014b9f2359..229f4a90b0bc 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinDatabasesOperations.cs @@ -47,7 +47,40 @@ public partial interface IRestorableGremlinDatabasesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinGraphsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinGraphsOperations.cs index 097871eb40e9..56f7f27d05db 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinGraphsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinGraphsOperations.cs @@ -54,7 +54,38 @@ public partial interface IRestorableGremlinGraphsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin graphs under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin graphs under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinResourcesOperations.cs index 852f5573bb66..6bcaffda57d5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableGremlinResourcesOperations.cs @@ -53,7 +53,40 @@ public partial interface IRestorableGremlinResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Return a list of gremlin database and graphs combo that exist on the + /// account at the given timestamp and location. This helps in scenarios to + /// validate what resources exist at given timestamp and location. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// Return a list of gremlin database and graphs combo that exist on the + /// account at the given timestamp and location. This helps in scenarios to + /// validate what resources exist at given timestamp and location. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbCollectionsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbCollectionsOperations.cs index 6e344a59399c..69314524429d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbCollectionsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbCollectionsOperations.cs @@ -54,7 +54,38 @@ public partial interface IRestorableMongodbCollectionsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB collections under a specific database. This helps in scenario + /// where container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB collections under a specific database. This helps in scenario + /// where container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbDatabasesOperations.cs index 6505411bd6f3..036188bcc059 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbDatabasesOperations.cs @@ -47,7 +47,40 @@ public partial interface IRestorableMongodbDatabasesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbResourcesOperations.cs index 5e1c5fa36d18..488aeb376d7d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableMongodbResourcesOperations.cs @@ -51,7 +51,38 @@ public partial interface IRestorableMongodbResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Return a list of database and collection combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// Return a list of database and collection combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlContainersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlContainersOperations.cs index 3a4d3c1e9d73..aabcd15b4f63 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlContainersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlContainersOperations.cs @@ -54,7 +54,38 @@ public partial interface IRestorableSqlContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// containers under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// containers under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlDatabasesOperations.cs index 3e2990eb2137..d1617872949d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlDatabasesOperations.cs @@ -47,7 +47,40 @@ public partial interface IRestorableSqlDatabasesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// databases under the restorable account. This helps in scenario where + /// database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// databases under the restorable account. This helps in scenario where + /// database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlResourcesOperations.cs index de427d31d745..6b7892029353 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableSqlResourcesOperations.cs @@ -51,7 +51,38 @@ public partial interface IRestorableSqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Return a list of database and container combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// Return a list of database and container combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTableResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTableResourcesOperations.cs index ec9341c69cc4..22ba6cf3c0c5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTableResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTableResourcesOperations.cs @@ -51,7 +51,38 @@ public partial interface IRestorableTableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Return a list of tables that exist on the account at the given timestamp + /// and location. This helps in scenarios to validate what resources exist at + /// given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// Return a list of tables that exist on the account at the given timestamp + /// and location. This helps in scenarios to validate what resources exist at + /// given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTablesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTablesOperations.cs index 5e5976b840b8..a9431f7db7e3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTablesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IRestorableTablesOperations.cs @@ -51,7 +51,38 @@ public partial interface IRestorableTablesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Tables. This helps in scenario where table was accidentally deleted. This + /// API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Tables. This helps in scenario where table was accidentally deleted. This + /// API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IServiceOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IServiceOperations.cs index 46229e62910d..98e2762f647b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IServiceOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/IServiceOperations.cs @@ -37,13 +37,13 @@ public partial interface IServiceOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates a service. + /// Gets the status of service. /// /// - /// Creates a service. + /// Gets the status of service. /// /// /// The name of the resource group. The name is case insensitive. @@ -54,9 +54,6 @@ public partial interface IServiceOperations /// /// Cosmos DB service name. /// - /// - /// The Service resource parameters. - /// /// /// The headers that will be added to request. /// @@ -69,13 +66,13 @@ public partial interface IServiceOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the status of service. + /// Creates a service. /// /// - /// Gets the status of service. + /// Creates a service. /// /// /// The name of the resource group. The name is case insensitive. @@ -86,6 +83,9 @@ public partial interface IServiceOperations /// /// Cosmos DB service name. /// + /// + /// The Service resource parameters. + /// /// /// The headers that will be added to request. /// @@ -98,7 +98,7 @@ public partial interface IServiceOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes service with the given serviceName. @@ -184,5 +184,28 @@ public partial interface IServiceOperations /// System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Gets the status of service. + /// + /// + /// Gets the status of service. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ISqlResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ISqlResourcesOperations.cs index c45af7609792..6a86b51a39bd 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ISqlResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ISqlResourcesOperations.cs @@ -37,7 +37,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListSqlDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the SQL database under an existing Azure Cosmos DB database account @@ -129,12 +129,12 @@ public partial interface ISqlResourcesOperations System.Threading.Tasks.Task> DeleteSqlDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the SQL database under an existing Azure Cosmos - /// DB database account with the provided name. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. /// /// - /// Gets the RUs per second of the SQL database under an existing Azure Cosmos - /// DB database account with the provided name. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. /// /// /// The name of the resource group. The name is case insensitive. @@ -157,13 +157,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListClientEncryptionKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL + /// database. /// /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL + /// database. /// /// /// The name of the resource group. The name is case insensitive. @@ -174,9 +176,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// database. + /// + /// Cosmos DB ClientEncryptionKey name. /// /// /// The headers that will be added to request. @@ -190,13 +191,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The name of the resource group. The name is case insensitive. @@ -207,6 +210,12 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB ClientEncryptionKey name. + /// + /// + /// The parameters to provide for the client encryption key. + /// /// /// The headers that will be added to request. /// @@ -219,13 +228,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Lists the SQL container under an existing Azure Cosmos DB database account. /// /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Lists the SQL container under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -248,13 +257,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlContainersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// - /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -265,6 +274,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// /// /// The headers that will be added to request. /// @@ -277,13 +289,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListSqlContainersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB SQL container /// /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -297,6 +309,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// + /// + /// The parameters to provide for the current SQL container. + /// /// /// The headers that will be added to request. /// @@ -309,13 +324,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL container + /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Create or update an Azure Cosmos DB SQL container + /// Deletes an existing Azure Cosmos DB SQL container. /// /// /// The name of the resource group. The name is case insensitive. @@ -329,8 +344,37 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the current SQL container. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> DeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves continuous backup information for a container resource. + /// + /// + /// Retrieves continuous backup information for a container resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// The name of the continuous backup restore location. /// /// /// The headers that will be added to request. @@ -344,13 +388,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL container. + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// - /// Deletes an existing Azure Cosmos DB SQL container. + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -373,15 +419,18 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListSqlStoredProceduresWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the SQL container under an existing Azure Cosmos - /// DB database account. + /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// - /// Gets the RUs per second of the SQL container under an existing Azure Cosmos - /// DB database account. + /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -395,6 +444,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The headers that will be added to request. /// @@ -407,13 +459,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The name of the resource group. The name is case insensitive. @@ -427,9 +479,11 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// container. + /// + /// Cosmos DB storedProcedure name. + /// + /// + /// The parameters to provide for the current SQL storedProcedure. /// /// /// The headers that will be added to request. @@ -443,15 +497,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The name of the resource group. The name is case insensitive. @@ -465,6 +517,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The headers that will be added to request. /// @@ -474,18 +529,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Gets the RUs per second of the SQL container under an existing Azure Cosmos + /// DB database account. /// /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Gets the RUs per second of the SQL container under an existing Azure Cosmos + /// DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -511,15 +563,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL - /// database. + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL - /// database. + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -530,6 +580,13 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// + /// + /// The parameters to provide for the RUs per second of the current SQL + /// container. + /// /// /// The headers that will be added to request. /// @@ -542,15 +599,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListClientEncryptionKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL - /// database. + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL - /// database. + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -561,8 +618,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// /// /// The headers that will be added to request. @@ -576,15 +633,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -595,11 +652,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. - /// - /// - /// The parameters to provide for the client encryption key. + /// + /// Cosmos DB container name. /// /// /// The headers that will be added to request. @@ -613,15 +667,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. /// /// - /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -647,15 +699,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListSqlStoredProceduresWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlTriggersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// - /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -669,8 +719,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// /// /// The headers that will be added to request. @@ -684,13 +734,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The name of the resource group. The name is case insensitive. @@ -704,11 +754,11 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// - /// - /// The parameters to provide for the current SQL storedProcedure. + /// + /// The parameters to provide for the current SQL trigger. /// /// /// The headers that will be added to request. @@ -722,13 +772,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The name of the resource group. The name is case insensitive. @@ -742,8 +792,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// /// /// The headers that will be added to request. @@ -754,7 +804,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB @@ -788,7 +838,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database @@ -898,10 +948,12 @@ public partial interface ISqlResourcesOperations System.Threading.Tasks.Task> DeleteSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// Gets the RUs per second of the SQL database under an existing Azure Cosmos + /// DB database account with the provided name. /// /// - /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// Gets the RUs per second of the SQL database under an existing Azure Cosmos + /// DB database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -912,9 +964,6 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// /// /// The headers that will be added to request. /// @@ -927,13 +976,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListSqlTriggersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the SQL trigger under an existing Azure Cosmos DB database account. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// - /// Gets the SQL trigger under an existing Azure Cosmos DB database account. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The name of the resource group. The name is case insensitive. @@ -944,11 +993,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. + /// + /// The parameters to provide for the RUs per second of the current SQL + /// database. /// /// /// The headers that will be added to request. @@ -962,13 +1009,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -979,15 +1026,6 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// - /// - /// The parameters to provide for the current SQL trigger. - /// /// /// The headers that will be added to request. /// @@ -1000,13 +1038,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1017,12 +1055,6 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// /// /// The headers that will be added to request. /// @@ -1032,19 +1064,17 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition - /// with the given Id. + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. /// /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition - /// with the given Id. + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1063,25 +1093,24 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment + /// with the given Id. /// /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment + /// with the given Id. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -1095,23 +1124,26 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// /// /// The headers that will be added to request. /// @@ -1121,13 +1153,16 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -1135,6 +1170,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// The headers that will be added to request. /// @@ -1144,22 +1182,14 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task>> ListSqlRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment - /// with the given Id. + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. /// /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment - /// with the given Id. + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1178,25 +1208,24 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition + /// with the given Id. /// /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition + /// with the given Id. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -1210,23 +1239,26 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// /// /// The headers that will be added to request. /// @@ -1236,13 +1268,16 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -1250,6 +1285,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// /// /// The headers that will be added to request. /// @@ -1259,16 +1297,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task>> ListSqlRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a container resource. + /// Create or update an Azure Cosmos DB SQL database /// /// - /// Retrieves continuous backup information for a container resource. + /// Create or update an Azure Cosmos DB SQL database /// /// /// The name of the resource group. The name is case insensitive. @@ -1279,11 +1314,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// The name of the continuous backup restore location. + /// + /// The parameters to provide for the current SQL database. /// /// /// The headers that will be added to request. @@ -1297,13 +1329,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL database + /// Deletes an existing Azure Cosmos DB SQL database. /// /// - /// Create or update an Azure Cosmos DB SQL database + /// Deletes an existing Azure Cosmos DB SQL database. /// /// /// The name of the resource group. The name is case insensitive. @@ -1314,9 +1346,6 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the current SQL database. - /// /// /// The headers that will be added to request. /// @@ -1326,16 +1355,15 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL database. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// - /// Deletes an existing Azure Cosmos DB SQL database. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The name of the resource group. The name is case insensitive. @@ -1346,6 +1374,12 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB ClientEncryptionKey name. + /// + /// + /// The parameters to provide for the client encryption key. + /// /// /// The headers that will be added to request. /// @@ -1355,13 +1389,16 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteSqlDatabaseWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Create or update an Azure Cosmos DB SQL container /// /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Create or update an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -1372,9 +1409,11 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// database. + /// + /// Cosmos DB container name. + /// + /// + /// The parameters to provide for the current SQL container. /// /// /// The headers that will be added to request. @@ -1388,13 +1427,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB SQL container. /// /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB SQL container. /// /// /// The name of the resource group. The name is case insensitive. @@ -1405,6 +1444,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// /// /// The headers that will be added to request. /// @@ -1414,16 +1456,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Retrieves continuous backup information for a container resource. /// /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Retrieves continuous backup information for a container resource. /// /// /// The name of the resource group. The name is case insensitive. @@ -1434,6 +1473,12 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// + /// + /// The name of the continuous backup restore location. + /// /// /// The headers that will be added to request. /// @@ -1446,13 +1491,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL container + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// - /// Create or update an Azure Cosmos DB SQL container + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The name of the resource group. The name is case insensitive. @@ -1466,8 +1511,11 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the current SQL container. + /// + /// Cosmos DB storedProcedure name. + /// + /// + /// The parameters to provide for the current SQL storedProcedure. /// /// /// The headers that will be added to request. @@ -1481,13 +1529,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL container. + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// - /// Deletes an existing Azure Cosmos DB SQL container. + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The name of the resource group. The name is case insensitive. @@ -1501,6 +1549,9 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The headers that will be added to request. /// @@ -1510,7 +1561,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Update RUs per second of an Azure Cosmos DB SQL container @@ -1617,12 +1668,10 @@ public partial interface ISqlResourcesOperations System.Threading.Tasks.Task> BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Create or update an Azure Cosmos DB SQL trigger /// /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The name of the resource group. The name is case insensitive. @@ -1633,11 +1682,14 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// - /// - /// The parameters to provide for the client encryption key. + /// + /// Cosmos DB trigger name. + /// + /// + /// The parameters to provide for the current SQL trigger. /// /// /// The headers that will be added to request. @@ -1651,13 +1703,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The name of the resource group. The name is case insensitive. @@ -1671,11 +1723,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - /// - /// The parameters to provide for the current SQL storedProcedure. + /// + /// Cosmos DB trigger name. /// /// /// The headers that will be added to request. @@ -1686,16 +1735,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The name of the resource group. The name is case insensitive. @@ -1709,8 +1755,11 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB userDefinedFunction name. + /// + /// + /// The parameters to provide for the current SQL userDefinedFunction. /// /// /// The headers that will be added to request. @@ -1721,13 +1770,16 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// /// The name of the resource group. The name is case insensitive. @@ -1744,8 +1796,35 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB userDefinedFunction name. /// - /// - /// The parameters to provide for the current SQL userDefinedFunction. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Update RUs per second of an Azure Cosmos DB SQL database + /// + /// + /// Update RUs per second of an Azure Cosmos DB SQL database + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The parameters to provide for the RUs per second of the current SQL + /// database. /// /// /// The headers that will be added to request. @@ -1759,13 +1838,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -1776,12 +1855,6 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB userDefinedFunction name. - /// /// /// The headers that will be added to request. /// @@ -1791,13 +1864,16 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1808,14 +1884,37 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB trigger name. + /// + /// The cancellation token. /// - /// - /// The parameters to provide for the current SQL trigger. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// + /// + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -1829,13 +1928,13 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -1843,14 +1942,8 @@ public partial interface ISqlResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -1861,7 +1954,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or updates an Azure Cosmos DB SQL Role Definition. @@ -1869,15 +1962,15 @@ public partial interface ISqlResourcesOperations /// /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// /// /// The properties required to create or update a Role Definition. /// @@ -1893,7 +1986,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes an existing Azure Cosmos DB SQL Role Definition. @@ -1901,15 +1994,15 @@ public partial interface ISqlResourcesOperations /// /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// /// /// The headers that will be added to request. /// @@ -1919,25 +2012,41 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Lists the SQL databases under an existing Azure Cosmos DB database account. /// /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Lists the SQL databases under an existing Azure Cosmos DB database account. /// - /// - /// The GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database account name. + /// + /// The cancellation token. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListSqlDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. + /// + /// + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1951,22 +2060,64 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListClientEncryptionKeysNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Lists the SQL container under an existing Azure Cosmos DB database account. /// /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Lists the SQL container under an existing Azure Cosmos DB database account. /// - /// - /// The GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database account name. + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListSqlContainersNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. + /// + /// + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListSqlStoredProceduresNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -1977,28 +2128,67 @@ public partial interface ISqlResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListSqlTriggersNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a container resource. + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. /// /// - /// Retrieves continuous backup information for a container resource. + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The headers that will be added to request. /// - /// - /// Cosmos DB database name. + /// + /// The cancellation token. /// - /// - /// Cosmos DB container name. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The name of the continuous backup restore location. + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListSqlRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -2012,7 +2202,7 @@ public partial interface ISqlResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListSqlRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ITableResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ITableResourcesOperations.cs index f29a7006c906..98be403e2d2a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ITableResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ITableResourcesOperations.cs @@ -14,10 +14,10 @@ namespace Microsoft.Azure.Management.CosmosDB public partial interface ITableResourcesOperations { /// - /// Lists the Tables under an existing Azure Cosmos DB database account. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// - /// Lists the Tables under an existing Azure Cosmos DB database account. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The name of the resource group. The name is case insensitive. @@ -37,15 +37,15 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListTableRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the Tables under an existing Azure Cosmos DB database account with the - /// provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Assignment with the given Id. /// /// - /// Gets the Tables under an existing Azure Cosmos DB database account with the - /// provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -53,8 +53,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -68,13 +68,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -82,11 +82,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The parameters to provide for the current Table. + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -100,13 +100,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -114,8 +114,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -126,15 +126,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Gets the RUs per second of the Table under an existing Azure Cosmos DB - /// database account with the provided name. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// - /// Gets the RUs per second of the Table under an existing Azure Cosmos DB - /// database account with the provided name. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// /// The name of the resource group. The name is case insensitive. @@ -142,9 +140,6 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. - /// /// /// The headers that will be added to request. /// @@ -157,13 +152,15 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListTableRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Definition with the given Id. /// /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Definition with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -171,11 +168,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. - /// - /// - /// The parameters to provide for the RUs per second of the current Table. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -189,13 +183,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -203,8 +197,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. /// /// /// The headers that will be added to request. @@ -218,13 +215,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> MigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -232,8 +229,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// The headers that will be added to request. @@ -244,16 +241,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> MigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves continuous backup information for a table. + /// Lists the Tables under an existing Azure Cosmos DB database account. /// /// - /// Retrieves continuous backup information for a table. + /// Lists the Tables under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -261,12 +255,6 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. - /// - /// - /// The name of the continuous backup restore location. - /// /// /// The headers that will be added to request. /// @@ -279,15 +267,15 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Definition with the given Id. + /// Gets the Tables under an existing Azure Cosmos DB database account with the + /// provided name. /// /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Definition with the given Id. + /// Gets the Tables under an existing Azure Cosmos DB database account with the + /// provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -295,8 +283,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -310,13 +298,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Create or update an Azure Cosmos DB Table /// /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Create or update an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -324,11 +312,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// The parameters to provide for the current Table. /// /// /// The headers that will be added to request. @@ -342,13 +330,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The name of the resource group. The name is case insensitive. @@ -356,8 +344,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -368,13 +356,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// Retrieves continuous backup information for a table. /// /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// Retrieves continuous backup information for a table. /// /// /// The name of the resource group. The name is case insensitive. @@ -382,6 +370,12 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB table name. + /// + /// + /// The name of the continuous backup restore location. + /// /// /// The headers that will be added to request. /// @@ -394,15 +388,15 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListTableRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Assignment with the given Id. + /// Gets the RUs per second of the Table under an existing Azure Cosmos DB + /// database account with the provided name. /// /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Assignment with the given Id. + /// Gets the RUs per second of the Table under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -410,8 +404,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -425,13 +419,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -439,11 +433,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// The parameters to provide for the RUs per second of the current Table. /// /// /// The headers that will be added to request. @@ -457,13 +451,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -471,8 +465,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -483,13 +477,16 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> DeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> MigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -497,6 +494,9 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB table name. + /// /// /// The headers that will be added to request. /// @@ -509,13 +509,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListTableRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> MigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -523,11 +523,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The parameters to provide for the current Table. + /// + /// The properties required to create or update a Role Assignment. /// /// /// The headers that will be added to request. @@ -541,13 +541,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -555,8 +555,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The headers that will be added to request. @@ -567,13 +567,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -581,11 +581,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// - /// - /// The parameters to provide for the RUs per second of the current Table. + /// + /// The properties required to create or update a Role Definition. /// /// /// The headers that will be added to request. @@ -599,13 +599,39 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginUpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Create or update an Azure Cosmos DB Table + /// + /// + /// Create or update an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -616,6 +642,9 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB table name. /// + /// + /// The parameters to provide for the current Table. + /// /// /// The headers that will be added to request. /// @@ -628,13 +657,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginMigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginCreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Deletes an existing Azure Cosmos DB Table. /// /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The name of the resource group. The name is case insensitive. @@ -654,10 +683,7 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// - System.Threading.Tasks.Task> BeginMigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Retrieves continuous backup information for a table. @@ -689,13 +715,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Update RUs per second of an Azure Cosmos DB Table /// /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -703,11 +729,11 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// The parameters to provide for the RUs per second of the current Table. /// /// /// The headers that will be added to request. @@ -721,13 +747,13 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginUpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -735,8 +761,8 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The headers that will be added to request. @@ -747,13 +773,16 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginMigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -761,11 +790,31 @@ public partial interface ITableResourcesOperations /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginMigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// + /// + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -779,22 +828,39 @@ public partial interface ITableResourcesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListTableRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The headers that will be added to request. /// - /// - /// The GUID for the Role Assignment. + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListTableRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Lists the Tables under an existing Azure Cosmos DB database account. + /// + /// + /// Lists the Tables under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -805,7 +871,10 @@ public partial interface ITableResourcesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task> BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListTablesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperations.cs index 40a511104904..0d68870e7e39 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperations.cs @@ -62,24 +62,18 @@ internal LocationsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2025-10-15"; + + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -87,7 +81,6 @@ internal LocationsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -97,12 +90,12 @@ internal LocationsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -197,7 +190,7 @@ internal LocationsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -267,23 +260,17 @@ internal LocationsOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -291,7 +278,6 @@ internal LocationsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); @@ -302,13 +288,13 @@ internal LocationsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -439,6 +425,188 @@ internal LocationsOperations (CosmosDBManagementClient client) + } + /// + /// List Cosmos DB locations and their properties + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperationsExtensions.cs index 96af02855b7b..00418867b10e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/LocationsOperationsExtensions.cs @@ -18,7 +18,7 @@ public static partial class LocationsOperationsExtensions /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this ILocationsOperations operations) + public static Microsoft.Rest.Azure.IPage List(this ILocationsOperations operations) { return ((ILocationsOperations)operations).ListAsync().GetAwaiter().GetResult(); } @@ -32,7 +32,7 @@ public static System.Collections.Generic.IEnumerable List(thi /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this ILocationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this ILocationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -72,5 +72,38 @@ public static LocationGetResult Get(this ILocationsOperations operations, string return _result.Body; } } + /// + /// List Cosmos DB locations and their properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this ILocationsOperations operations, string nextPageLink) + { + return ((ILocationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List Cosmos DB locations and their properties + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ILocationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMProxyResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMProxyResource.cs index 1e76e7e80400..a262fd93d1e5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMProxyResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMProxyResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// The resource model definition for a ARM proxy resource. It will have /// everything other than required location and tags /// - public partial class ARMProxyResource : Microsoft.Rest.Azure.IResource + public partial class ARMProxyResource { /// /// Initializes a new instance of the ARMProxyResource class. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMResourceProperties.cs index ef384796f98f..6c2fd2a4c74b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMResourceProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ARMResourceProperties.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// The core properties of ARM resources. /// - public partial class ARMResourceProperties : Microsoft.Rest.Azure.IResource + public partial class ARMResourceProperties { /// /// Initializes a new instance of the ARMResourceProperties class. @@ -44,7 +44,10 @@ public ARMResourceProperties() /// with "defaultExperience": "Cassandra". Current "defaultExperience" values /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// - public ARMResourceProperties(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + /// Identity for the resource. + /// + public ARMResourceProperties(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) { this.Id = id; @@ -52,6 +55,7 @@ public ARMResourceProperties() this.Type = type; this.Location = location; this.Tags = tags; + this.Identity = identity; CustomInit(); } @@ -98,5 +102,11 @@ public ARMResourceProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NodeStatus.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/AutoReplicate.cs similarity index 62% rename from src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NodeStatus.cs rename to src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/AutoReplicate.cs index 4eeedc8c69e9..3b39712effc4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NodeStatus.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/AutoReplicate.cs @@ -7,13 +7,14 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { /// - /// Defines values for NodeStatus. + /// Defines values for AutoReplicate. /// - public static class NodeStatus + public static class AutoReplicate { - public const string Up = "Up"; - public const string Down = "Down"; + public const string None = "None"; + public const string SystemKeyspaces = "SystemKeyspaces"; + public const string AllKeyspaces = "AllKeyspaces"; } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupInformation.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupInformation.cs index bc873dffc5e6..a93664109046 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupInformation.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupInformation.cs @@ -40,9 +40,9 @@ public BackupInformation() /// - /// Gets information about the status of continuous backups. + /// Gets or sets information about the status of continuous backups. /// [Newtonsoft.Json.JsonProperty(PropertyName = "continuousBackupInformation")] - public ContinuousBackupInformation ContinuousBackupInformation {get; private set; } + public ContinuousBackupInformation ContinuousBackupInformation {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupSchedule.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupSchedule.cs new file mode 100644 index 000000000000..947eea3c3c2a --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/BackupSchedule.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 BackupSchedule + { + /// + /// Initializes a new instance of the BackupSchedule class. + /// + public BackupSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupSchedule class. + /// + + /// The unique identifier of backup schedule. + /// + + /// The cron expression that defines when you want to back up your data. + /// + + /// The retention period (hours) of the backups. If you want to retain data + /// forever, set retention to 0. + /// + public BackupSchedule(string scheduleName = default(string), string cronExpression = default(string), int? retentionInHours = default(int?)) + + { + this.ScheduleName = scheduleName; + this.CronExpression = cronExpression; + this.RetentionInHours = retentionInHours; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier of backup schedule. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduleName")] + public string ScheduleName {get; set; } + + /// + /// Gets or sets the cron expression that defines when you want to back up your + /// data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "cronExpression")] + public string CronExpression {get; set; } + + /// + /// Gets or sets the retention period (hours) of the backups. If you want to + /// retain data forever, set retention to 0. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "retentionInHours")] + public int? RetentionInHours {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersCreateUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersCreateUpdateHeaders.cs new file mode 100644 index 000000000000..75174603e829 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersCreateUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersCreateUpdateHeaders + { + /// + /// Initializes a new instance of the CassandraClustersCreateUpdateHeaders class. + /// + public CassandraClustersCreateUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersCreateUpdateHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersCreateUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeallocateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeallocateHeaders.cs new file mode 100644 index 000000000000..df9b6069d6c6 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeallocateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersDeallocateHeaders + { + /// + /// Initializes a new instance of the CassandraClustersDeallocateHeaders class. + /// + public CassandraClustersDeallocateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersDeallocateHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersDeallocateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeleteHeaders.cs new file mode 100644 index 000000000000..5045593418da --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersDeleteHeaders + { + /// + /// Initializes a new instance of the CassandraClustersDeleteHeaders class. + /// + public CassandraClustersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersDeleteHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersInvokeCommandHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersInvokeCommandHeaders.cs new file mode 100644 index 000000000000..4da84934a5b9 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersInvokeCommandHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersInvokeCommandHeaders + { + /// + /// Initializes a new instance of the CassandraClustersInvokeCommandHeaders class. + /// + public CassandraClustersInvokeCommandHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersInvokeCommandHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersInvokeCommandHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersStartHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersStartHeaders.cs new file mode 100644 index 000000000000..9d083366cd22 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersStartHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersStartHeaders + { + /// + /// Initializes a new instance of the CassandraClustersStartHeaders class. + /// + public CassandraClustersStartHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersStartHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersStartHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersUpdateHeaders.cs new file mode 100644 index 000000000000..fae97858af41 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraClustersUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraClustersUpdateHeaders + { + /// + /// Initializes a new instance of the CassandraClustersUpdateHeaders class. + /// + public CassandraClustersUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraClustersUpdateHeaders class. + /// + + /// + /// + + /// + /// + public CassandraClustersUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersCreateUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersCreateUpdateHeaders.cs new file mode 100644 index 000000000000..60ad7e16e55a --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersCreateUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraDataCentersCreateUpdateHeaders + { + /// + /// Initializes a new instance of the CassandraDataCentersCreateUpdateHeaders class. + /// + public CassandraDataCentersCreateUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraDataCentersCreateUpdateHeaders class. + /// + + /// + /// + + /// + /// + public CassandraDataCentersCreateUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersDeleteHeaders.cs new file mode 100644 index 000000000000..a2a521e03a51 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraDataCentersDeleteHeaders + { + /// + /// Initializes a new instance of the CassandraDataCentersDeleteHeaders class. + /// + public CassandraDataCentersDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraDataCentersDeleteHeaders class. + /// + + /// + /// + + /// + /// + public CassandraDataCentersDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersUpdateHeaders.cs new file mode 100644 index 000000000000..30fed15e330e --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraDataCentersUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraDataCentersUpdateHeaders + { + /// + /// Initializes a new instance of the CassandraDataCentersUpdateHeaders class. + /// + public CassandraDataCentersUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraDataCentersUpdateHeaders class. + /// + + /// + /// + + /// + /// + public CassandraDataCentersUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs index 2e5fc0da68fc..6f1407333d9b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public CassandraKeyspaceCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a Cassandra keyspace /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public CassandraKeyspaceCreateUpdateParameters(CassandraKeyspaceResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public CassandraKeyspaceCreateUpdateParameters(CassandraKeyspaceResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs index b04fb6dcfeb7..d587facc35ff 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class CassandraKeyspaceGetPropertiesResource + public partial class CassandraKeyspaceGetPropertiesResource : CassandraKeyspaceResource { /// /// Initializes a new instance of the CassandraKeyspaceGetPropertiesResource class. @@ -36,8 +36,8 @@ public CassandraKeyspaceGetPropertiesResource() /// public CassandraKeyspaceGetPropertiesResource(string id, string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id) { - this.Id = id; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -50,12 +50,6 @@ public CassandraKeyspaceGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB Cassandra keyspace - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -81,13 +75,9 @@ public CassandraKeyspaceGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetResults.cs index a518c182b7ba..49a901005d44 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraKeyspaceGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Cassandra keyspace. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class CassandraKeyspaceGetResults : ARMResourceProperties + public partial class CassandraKeyspaceGetResults : Resource { /// /// Initializes a new instance of the CassandraKeyspaceGetResults class. @@ -25,25 +25,28 @@ public CassandraKeyspaceGetResults() /// Initializes a new instance of the CassandraKeyspaceGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public CassandraKeyspaceGetResults() /// /// - public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource), CassandraKeyspaceGetPropertiesOptions options = default(CassandraKeyspaceGetPropertiesOptions)) + public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource), CassandraKeyspaceGetPropertiesOptions options = default(CassandraKeyspaceGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public CassandraKeyspaceGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public CassandraKeyspaceGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraKeyspaceHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraKeyspaceHeaders.cs index 9dd5289ab190..909bf4ee09be 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraKeyspaceHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraKeyspaceHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesCreateUpdateCassandraKeyspaceHeaders() /// /// - public CassandraResourcesCreateUpdateCassandraKeyspaceHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesCreateUpdateCassandraKeyspaceHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesCreateUpdateCassandraKeyspaceHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..677f4f164334 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders class. + /// + public CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public CassandraResourcesCreateUpdateCassandraRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..c78c20e59ce1 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders class. + /// + public CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public CassandraResourcesCreateUpdateCassandraRoleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraTableHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraTableHeaders.cs index e07ec9dc5ca5..f79a7b2e1692 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraTableHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesCreateUpdateCassandraTableHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesCreateUpdateCassandraTableHeaders() /// /// - public CassandraResourcesCreateUpdateCassandraTableHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesCreateUpdateCassandraTableHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesCreateUpdateCassandraTableHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraKeyspaceHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraKeyspaceHeaders.cs index 5eb355f39f8c..ecf4ac0cfbc3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraKeyspaceHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraKeyspaceHeaders.cs @@ -43,13 +43,13 @@ public CassandraResourcesDeleteCassandraKeyspaceHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..eb06f66175cf --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleAssignmentHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraResourcesDeleteCassandraRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the CassandraResourcesDeleteCassandraRoleAssignmentHeaders class. + /// + public CassandraResourcesDeleteCassandraRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraResourcesDeleteCassandraRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + public CassandraResourcesDeleteCassandraRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..be0f99b8f7f3 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 CassandraResourcesDeleteCassandraRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the CassandraResourcesDeleteCassandraRoleDefinitionHeaders class. + /// + public CassandraResourcesDeleteCassandraRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraResourcesDeleteCassandraRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public CassandraResourcesDeleteCassandraRoleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraTableHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraTableHeaders.cs index 510f59972662..4a20e7eb2040 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraTableHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesDeleteCassandraTableHeaders.cs @@ -43,13 +43,13 @@ public CassandraResourcesDeleteCassandraTableHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders.cs index b6685e7407fb..e2eca002557f 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders() /// /// - public CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesMigrateCassandraKeyspaceToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders.cs index 168ad832e615..73b2664b3b76 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders() /// /// - public CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesMigrateCassandraKeyspaceToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToAutoscaleHeaders.cs index 75652b16d097..399da24b682e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesMigrateCassandraTableToAutoscaleHeaders() /// /// - public CassandraResourcesMigrateCassandraTableToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesMigrateCassandraTableToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesMigrateCassandraTableToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToManualThroughputHeaders.cs index ae3dc165b1b8..a456fca2bd74 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesMigrateCassandraTableToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesMigrateCassandraTableToManualThroughputHeaders() /// /// - public CassandraResourcesMigrateCassandraTableToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesMigrateCassandraTableToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesMigrateCassandraTableToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders.cs index 618274987062..e31191d6586d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders() /// /// - public CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesUpdateCassandraKeyspaceThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraTableThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraTableThroughputHeaders.cs index 46fdd0a31190..d3436e8e8b86 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraTableThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraResourcesUpdateCassandraTableThroughputHeaders.cs @@ -26,11 +26,15 @@ public CassandraResourcesUpdateCassandraTableThroughputHeaders() /// /// - public CassandraResourcesUpdateCassandraTableThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public CassandraResourcesUpdateCassandraTableThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public CassandraResourcesUpdateCassandraTableThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResource.cs new file mode 100644 index 000000000000..b613d88262f6 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResource.cs @@ -0,0 +1,104 @@ +// 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 and update an Azure Cosmos DB Cassandra Role + /// Assignment. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class CassandraRoleAssignmentResource : ProxyResource + { + /// + /// Initializes a new instance of the CassandraRoleAssignmentResource class. + /// + public CassandraRoleAssignmentResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraRoleAssignmentResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// Cassandra Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this Cassandra Role Assignment. + /// Tenant ID for the principal is inferred using the tenant associated with + /// the subscription. + /// + + /// Provisioning state of the resource. + /// + public CassandraRoleAssignmentResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + : base(id, name, type, systemData) + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this Cassandra Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this Cassandra Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResourceProperties.cs new file mode 100644 index 000000000000..a65821d5fefa --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleAssignmentResourceProperties.cs @@ -0,0 +1,86 @@ +// 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; + + /// + /// Azure Cosmos DB Cassandra Role Assignment resource object. + /// + public partial class CassandraRoleAssignmentResourceProperties + { + /// + /// Initializes a new instance of the CassandraRoleAssignmentResourceProperties class. + /// + public CassandraRoleAssignmentResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraRoleAssignmentResourceProperties class. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// Cassandra Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this Cassandra Role Assignment. + /// Tenant ID for the principal is inferred using the tenant associated with + /// the subscription. + /// + + /// Provisioning state of the resource. + /// + public CassandraRoleAssignmentResourceProperties(string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this Cassandra Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this Cassandra Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResource.cs new file mode 100644 index 000000000000..75ab0ddab830 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResource.cs @@ -0,0 +1,119 @@ +// 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 and update an Azure Cosmos DB Cassandra Role + /// Definition. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class CassandraRoleDefinitionResource : ProxyResource + { + /// + /// Initializes a new instance of the CassandraRoleDefinitionResource class. + /// + public CassandraRoleDefinitionResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraRoleDefinitionResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which Cassandra Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public CassandraRoleDefinitionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string propertiesId = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + : base(id, name, type, systemData) + { + this.PropertiesId = propertiesId; + this.RoleName = roleName; + this.PropertiesType = propertiesType; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.id")] + public string PropertiesId {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public RoleDefinitionType? PropertiesType {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which Cassandra + /// Role Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResourceProperties.cs new file mode 100644 index 000000000000..c1f19980db88 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraRoleDefinitionResourceProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + /// + /// Azure Cosmos DB Cassandra Role Definition resource object. + /// + public partial class CassandraRoleDefinitionResourceProperties + { + /// + /// Initializes a new instance of the CassandraRoleDefinitionResourceProperties class. + /// + public CassandraRoleDefinitionResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CassandraRoleDefinitionResourceProperties class. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which Cassandra Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public CassandraRoleDefinitionResourceProperties(string id = default(string), string roleName = default(string), RoleDefinitionType? type = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + { + this.Id = id; + this.RoleName = roleName; + this.Type = type; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public RoleDefinitionType? Type {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which Cassandra + /// Role Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableCreateUpdateParameters.cs index b7543897bd73..72acd873fd7d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public CassandraTableCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a Cassandra table /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public CassandraTableCreateUpdateParameters(CassandraTableResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public CassandraTableCreateUpdateParameters(CassandraTableResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetPropertiesResource.cs index d658cde4893b..ba8a3bd9e445 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class CassandraTableGetPropertiesResource + public partial class CassandraTableGetPropertiesResource : CassandraTableResource { /// /// Initializes a new instance of the CassandraTableGetPropertiesResource class. @@ -45,11 +45,8 @@ public CassandraTableGetPropertiesResource() /// public CassandraTableGetPropertiesResource(string id, int? defaultTtl = default(int?), CassandraSchema schema = default(CassandraSchema), int? analyticalStorageTtl = default(int?), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, defaultTtl, schema, analyticalStorageTtl) { - this.Id = id; - this.DefaultTtl = defaultTtl; - this.Schema = schema; - this.AnalyticalStorageTtl = analyticalStorageTtl; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -62,30 +59,6 @@ public CassandraTableGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB Cassandra table - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets time to live of the Cosmos DB Cassandra table - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultTtl")] - public int? DefaultTtl {get; set; } - - /// - /// Gets or sets schema of the Cosmos DB Cassandra table - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "schema")] - public CassandraSchema Schema {get; set; } - - /// - /// Gets or sets analytical TTL. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "analyticalStorageTtl")] - public int? AnalyticalStorageTtl {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -111,14 +84,9 @@ public CassandraTableGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetResults.cs index 19ed2d655ac0..215979b6457a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/CassandraTableGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Cassandra table. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class CassandraTableGetResults : ARMResourceProperties + public partial class CassandraTableGetResults : Resource { /// /// Initializes a new instance of the CassandraTableGetResults class. @@ -25,25 +25,28 @@ public CassandraTableGetResults() /// Initializes a new instance of the CassandraTableGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public CassandraTableGetResults() /// /// - public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource), CassandraTableGetPropertiesOptions options = default(CassandraTableGetPropertiesOptions)) + public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource), CassandraTableGetPropertiesOptions options = default(CassandraTableGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public CassandraTableGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public CassandraTableGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetPropertiesResource.cs index c4c705376880..dfd262282268 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class ClientEncryptionKeyGetPropertiesResource + public partial class ClientEncryptionKeyGetPropertiesResource : ClientEncryptionKeyResource { /// /// Initializes a new instance of the ClientEncryptionKeyGetPropertiesResource class. @@ -47,11 +47,8 @@ public ClientEncryptionKeyGetPropertiesResource() /// public ClientEncryptionKeyGetPropertiesResource(string id = default(string), string encryptionAlgorithm = default(string), byte[] wrappedDataEncryptionKey = default(byte[]), KeyWrapMetadata keyWrapMetadata = default(KeyWrapMetadata), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, encryptionAlgorithm, wrappedDataEncryptionKey, keyWrapMetadata) { - this.Id = id; - this.EncryptionAlgorithm = encryptionAlgorithm; - this.WrappedDataEncryptionKey = wrappedDataEncryptionKey; - this.KeyWrapMetadata = keyWrapMetadata; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -64,33 +61,6 @@ public ClientEncryptionKeyGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the ClientEncryptionKey - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets encryption algorithm that will be used along with this client - /// encryption key to encrypt/decrypt data. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "encryptionAlgorithm")] - public string EncryptionAlgorithm {get; set; } - - /// - /// Gets or sets wrapped (encrypted) form of the key represented as a byte - /// array. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "wrappedDataEncryptionKey")] - public byte[] WrappedDataEncryptionKey {get; set; } - - /// - /// Gets or sets metadata for the wrapping provider that can be used to unwrap - /// the wrapped client encryption key. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "keyWrapMetadata")] - public KeyWrapMetadata KeyWrapMetadata {get; set; } - /// /// Gets a system generated property. A unique identifier. /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetResults.cs index 91ab25a020a9..b0d8f33e26a1 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClientEncryptionKeyGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// Client Encryption Key. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class ClientEncryptionKeyGetResults : ARMProxyResource + public partial class ClientEncryptionKeyGetResults : ProxyResource { /// /// Initializes a new instance of the ClientEncryptionKeyGetResults class. @@ -25,20 +25,26 @@ public ClientEncryptionKeyGetResults() /// Initializes a new instance of the ClientEncryptionKeyGetResults class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// /// - public ClientEncryptionKeyGetResults(string id = default(string), string name = default(string), string type = default(string), ClientEncryptionKeyGetPropertiesResource resource = default(ClientEncryptionKeyGetPropertiesResource)) + public ClientEncryptionKeyGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ClientEncryptionKeyGetPropertiesResource resource = default(ClientEncryptionKeyGetPropertiesResource)) - : base(id, name, type) + : base(id, name, type, systemData) { this.Resource = resource; CustomInit(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResource.cs index f105e933c72e..1c43143b73ae 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// Representation of a managed Cassandra cluster. /// - public partial class ClusterResource : ManagedCassandraARMResourceProperties + public partial class ClusterResource : Resource { /// /// Initializes a new instance of the ClusterResource class. @@ -24,37 +24,40 @@ public ClusterResource() /// Initializes a new instance of the ClusterResource class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Properties of a managed Cassandra cluster. /// - /// Identity for the resource. + /// Resource tags. /// - /// Properties of a managed Cassandra cluster. + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// - public ClusterResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedCassandraManagedServiceIdentity identity = default(ManagedCassandraManagedServiceIdentity), ClusterResourceProperties properties = default(ClusterResourceProperties)) + public ClusterResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ClusterResourceProperties properties = default(ClusterResourceProperties), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedCassandraManagedServiceIdentity identity = default(ManagedCassandraManagedServiceIdentity)) - : base(id, name, type, location, tags, identity) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.Identity = identity; CustomInit(); } @@ -69,5 +72,23 @@ public ClusterResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ClusterResourceProperties Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedCassandraManagedServiceIdentity Identity {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResourceProperties.cs index f27786177b83..be6dbd262d30 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResourceProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ClusterResourceProperties.cs @@ -70,6 +70,9 @@ public ClusterResourceProperties() /// already doing your own repairs. /// + /// The form of AutoReplicate that is being used by this cluster. + /// Possible values include: 'None', 'SystemKeyspaces', 'AllKeyspaces' + /// List of TLS certificates used to authorize clients connecting to the /// cluster. All connections are TLS encrypted whether clientCertificates is /// set or not, but if clientCertificates is set, the managed Cassandra cluster @@ -95,6 +98,10 @@ public ClusterResourceProperties() /// should be added to the seed node lists of all unmanaged nodes. /// + /// List of the data center names for unmanaged data centers in this cluster to + /// be included in auto-replication. + /// + /// (Deprecated) Number of hours to wait between taking a backup of the /// cluster. /// @@ -108,13 +115,22 @@ public ClusterResourceProperties() /// Error related to resource provisioning. /// + /// Extensions to be added or updated on cluster. + /// + + /// List of backup schedules that define when you want to back up your data. + /// + + /// How the nodes in the cluster react to scheduled events + /// Possible values include: 'Ignore', 'StopAny', 'StopByRack' + /// How to connect to the azure services needed for running the cluster /// Possible values include: 'None', 'VPN' - /// If the Connection Method is VPN, this is the Id of the private link + /// If the Connection Method is Vpn, this is the Id of the private link /// resource that the datacenters need to connect to. /// - public ClusterResourceProperties(string provisioningState = default(string), string restoreFromBackupId = default(string), string delegatedManagementSubnetId = default(string), string cassandraVersion = default(string), string clusterNameOverride = default(string), string authenticationMethod = default(string), string initialCassandraAdminPassword = default(string), SeedNode prometheusEndpoint = default(SeedNode), bool? repairEnabled = default(bool?), System.Collections.Generic.IList clientCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalGossipCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList gossipCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalSeedNodes = default(System.Collections.Generic.IList), System.Collections.Generic.IList seedNodes = default(System.Collections.Generic.IList), int? hoursBetweenBackups = default(int?), bool? deallocated = default(bool?), bool? cassandraAuditLoggingEnabled = default(bool?), CassandraError provisionError = default(CassandraError), string azureConnectionMethod = default(string), string privateLinkResourceId = default(string)) + public ClusterResourceProperties(string provisioningState = default(string), string restoreFromBackupId = default(string), string delegatedManagementSubnetId = default(string), string cassandraVersion = default(string), string clusterNameOverride = default(string), string authenticationMethod = default(string), string initialCassandraAdminPassword = default(string), SeedNode prometheusEndpoint = default(SeedNode), bool? repairEnabled = default(bool?), string autoReplicate = default(string), System.Collections.Generic.IList clientCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalGossipCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList gossipCertificates = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalSeedNodes = default(System.Collections.Generic.IList), System.Collections.Generic.IList seedNodes = default(System.Collections.Generic.IList), System.Collections.Generic.IList externalDataCenters = default(System.Collections.Generic.IList), int? hoursBetweenBackups = default(int?), bool? deallocated = default(bool?), bool? cassandraAuditLoggingEnabled = default(bool?), CassandraError provisionError = default(CassandraError), System.Collections.Generic.IList extensions = default(System.Collections.Generic.IList), System.Collections.Generic.IList backupSchedules = default(System.Collections.Generic.IList), string scheduledEventStrategy = default(string), string azureConnectionMethod = default(string), string privateLinkResourceId = default(string)) { this.ProvisioningState = provisioningState; @@ -126,15 +142,20 @@ public ClusterResourceProperties() this.InitialCassandraAdminPassword = initialCassandraAdminPassword; this.PrometheusEndpoint = prometheusEndpoint; this.RepairEnabled = repairEnabled; + this.AutoReplicate = autoReplicate; this.ClientCertificates = clientCertificates; this.ExternalGossipCertificates = externalGossipCertificates; this.GossipCertificates = gossipCertificates; this.ExternalSeedNodes = externalSeedNodes; this.SeedNodes = seedNodes; + this.ExternalDataCenters = externalDataCenters; this.HoursBetweenBackups = hoursBetweenBackups; this.Deallocated = deallocated; this.CassandraAuditLoggingEnabled = cassandraAuditLoggingEnabled; this.ProvisionError = provisionError; + this.Extensions = extensions; + this.BackupSchedules = backupSchedules; + this.ScheduledEventStrategy = scheduledEventStrategy; this.AzureConnectionMethod = azureConnectionMethod; this.PrivateLinkResourceId = privateLinkResourceId; CustomInit(); @@ -220,6 +241,12 @@ public ClusterResourceProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "repairEnabled")] public bool? RepairEnabled {get; set; } + /// + /// Gets or sets the form of AutoReplicate that is being used by this cluster. Possible values include: 'None', 'SystemKeyspaces', 'AllKeyspaces' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "autoReplicate")] + public string AutoReplicate {get; set; } + /// /// Gets or sets list of TLS certificates used to authorize clients connecting /// to the cluster. All connections are TLS encrypted whether @@ -263,6 +290,13 @@ public ClusterResourceProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "seedNodes")] public System.Collections.Generic.IList SeedNodes {get; private set; } + /// + /// Gets or sets list of the data center names for unmanaged data centers in + /// this cluster to be included in auto-replication. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "externalDataCenters")] + public System.Collections.Generic.IList ExternalDataCenters {get; set; } + /// /// Gets or sets (Deprecated) Number of hours to wait between taking a backup /// of the cluster. @@ -289,6 +323,25 @@ public ClusterResourceProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "provisionError")] public CassandraError ProvisionError {get; set; } + /// + /// Gets or sets extensions to be added or updated on cluster. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "extensions")] + public System.Collections.Generic.IList Extensions {get; set; } + + /// + /// Gets or sets list of backup schedules that define when you want to back up + /// your data. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "backupSchedules")] + public System.Collections.Generic.IList BackupSchedules {get; set; } + + /// + /// Gets or sets how the nodes in the cluster react to scheduled events Possible values include: 'Ignore', 'StopAny', 'StopByRack' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scheduledEventStrategy")] + public string ScheduledEventStrategy {get; set; } + /// /// Gets or sets how to connect to the azure services needed for running the /// cluster Possible values include: 'None', 'VPN' @@ -297,7 +350,7 @@ public ClusterResourceProperties() public string AzureConnectionMethod {get; set; } /// - /// Gets if the Connection Method is VPN, this is the Id of the private link + /// Gets if the Connection Method is Vpn, this is the Id of the private link /// resource that the datacenters need to connect to. /// [Newtonsoft.Json.JsonProperty(PropertyName = "privateLinkResourceId")] diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.cs index c7f444dc9774..7da9161e5204 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems.cs @@ -77,7 +77,10 @@ public ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersI /// A float representing the current system-wide CPU utilization as a /// percentage. /// - public ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems(string address = default(string), string state = default(string), string status = default(string), string cassandraProcessStatus = default(string), string load = default(string), System.Collections.Generic.IList tokens = default(System.Collections.Generic.IList), int? size = default(int?), string hostId = default(string), string rack = default(string), string timestamp = default(string), long? diskUsedKb = default(long?), long? diskFreeKb = default(long?), long? memoryUsedKb = default(long?), long? memoryBuffersAndCachedKb = default(long?), long? memoryFreeKb = default(long?), long? memoryTotalKb = default(long?), double? cpuUsage = default(double?)) + + /// If node has been updated to latest model + /// + public ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersItemsPropertiesNodesItems(string address = default(string), string state = default(string), string status = default(string), string cassandraProcessStatus = default(string), string load = default(string), System.Collections.Generic.IList tokens = default(System.Collections.Generic.IList), int? size = default(int?), string hostId = default(string), string rack = default(string), string timestamp = default(string), long? diskUsedKb = default(long?), long? diskFreeKb = default(long?), long? memoryUsedKb = default(long?), long? memoryBuffersAndCachedKb = default(long?), long? memoryFreeKb = default(long?), long? memoryTotalKb = default(long?), double? cpuUsage = default(double?), bool? isLatestModel = default(bool?)) { this.Address = address; @@ -97,6 +100,7 @@ public ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersI this.MemoryFreeKb = memoryFreeKb; this.MemoryTotalKb = memoryTotalKb; this.CpuUsage = cpuUsage; + this.IsLatestModel = isLatestModel; CustomInit(); } @@ -216,5 +220,11 @@ public ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersI /// [Newtonsoft.Json.JsonProperty(PropertyName = "cpuUsage")] public double? CpuUsage {get; set; } + + /// + /// Gets or sets if node has been updated to latest model + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isLatestModel")] + public bool? IsLatestModel {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ContinuousModeProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ContinuousModeProperties.cs index dd601a09ad20..01d4c2a4ba3c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ContinuousModeProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ContinuousModeProperties.cs @@ -24,7 +24,7 @@ public ContinuousModeProperties() /// Initializes a new instance of the ContinuousModeProperties class. /// - /// Enum to indicate type of Continuous backup mode + /// Enum to indicate type of Continuos backup mode /// Possible values include: 'Continuous7Days', 'Continuous30Days' public ContinuousModeProperties(string tier = default(string)) @@ -40,7 +40,7 @@ public ContinuousModeProperties() /// - /// Gets or sets enum to indicate type of Continuous backup mode Possible values include: 'Continuous7Days', 'Continuous30Days' + /// Gets or sets enum to indicate type of Continuos backup mode Possible values include: 'Continuous7Days', 'Continuous30Days' /// [Newtonsoft.Json.JsonProperty(PropertyName = "tier")] public string Tier {get; set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataCenterResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataCenterResource.cs index 2d3b232705c6..da90b21bb1a1 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataCenterResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataCenterResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// A managed Cassandra data center. /// - public partial class DataCenterResource : ARMProxyResource + public partial class DataCenterResource : ProxyResource { /// /// Initializes a new instance of the DataCenterResource class. @@ -24,20 +24,26 @@ public DataCenterResource() /// Initializes a new instance of the DataCenterResource class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Properties of a managed Cassandra data center. /// - public DataCenterResource(string id = default(string), string name = default(string), string type = default(string), DataCenterResourceProperties properties = default(DataCenterResourceProperties)) + public DataCenterResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), DataCenterResourceProperties properties = default(DataCenterResourceProperties)) - : base(id, name, type) + : base(id, name, type, systemData) { this.Properties = properties; CustomInit(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataTransferServiceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataTransferServiceResource.cs deleted file mode 100644 index 82495034fec3..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DataTransferServiceResource.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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; - - /// - /// Describes the service response property. - /// - public partial class DataTransferServiceResource - { - /// - /// Initializes a new instance of the DataTransferServiceResource class. - /// - public DataTransferServiceResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataTransferServiceResource class. - /// - - /// Properties for DataTransferServiceResource. - /// - public DataTransferServiceResource(DataTransferServiceResourceProperties properties = default(DataTransferServiceResourceProperties)) - - { - this.Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets properties for DataTransferServiceResource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public DataTransferServiceResourceProperties Properties {get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.Properties != null) - { - this.Properties.Validate(); - } - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateParameters.cs index 93169c7797db..3e78ef208859 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateParameters.cs @@ -46,19 +46,16 @@ public DatabaseAccountCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// Indicates the type of database account. This can only be set at database /// account creation. /// Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - /// Identity for the resource. - /// - /// The consistency policy for the Cosmos DB account. /// - /// List of IpRules. - /// - /// The cassandra connector offer type for the Cosmos DB database C* account. /// Possible values include: 'Small' @@ -82,6 +79,9 @@ public DatabaseAccountCreateUpdateParameters() /// DB account. /// + /// List of IpRules. + /// + /// Flag to indicate whether to enable/disable Virtual Network ACL rules. /// @@ -150,22 +150,18 @@ public DatabaseAccountCreateUpdateParameters() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// Flag to indicate enabling/disabling of Priority Based Execution Preview /// feature on the account /// @@ -173,14 +169,20 @@ public DatabaseAccountCreateUpdateParameters() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountCreateUpdateParameters(System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), string createMode = default(string), BackupPolicy backupPolicy = default(BackupPolicy), RestoreParameters restoreParameters = default(RestoreParameters), Capacity capacity = default(Capacity), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) - : base(id, name, type, location, tags) + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountCreateUpdateParameters(System.Collections.Generic.IList locations, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string kind = default(string), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), string createMode = default(string), BackupPolicy backupPolicy = default(BackupPolicy), RestoreParameters restoreParameters = default(RestoreParameters), Capacity capacity = default(Capacity), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) + + : base(id, name, type, location, tags, identity) { this.Kind = kind; - this.Identity = identity; this.ConsistencyPolicy = consistencyPolicy; - this.IPRules = ipRules; this.ConnectorOffer = connectorOffer; this.ApiProperties = apiProperties; this.CreateMode = createMode; @@ -188,6 +190,7 @@ public DatabaseAccountCreateUpdateParameters() this.RestoreParameters = restoreParameters; this.Capacity = capacity; this.Locations = locations; + this.IPRules = ipRules; this.IsVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; this.EnableAutomaticFailover = enableAutomaticFailover; this.Capabilities = capabilities; @@ -207,12 +210,13 @@ public DatabaseAccountCreateUpdateParameters() this.DisableLocalAuth = disableLocalAuth; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } /// @@ -236,24 +240,12 @@ static DatabaseAccountCreateUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] public string Kind {get; set; } - /// - /// Gets or sets identity for the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity {get; set; } - /// /// Gets or sets the consistency policy for the Cosmos DB account. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.consistencyPolicy")] public ConsistencyPolicy ConsistencyPolicy {get; set; } - /// - /// Gets or sets list of IpRules. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] - public System.Collections.Generic.IList IPRules {get; set; } - /// /// Gets or sets the cassandra connector offer type for the Cosmos DB database /// C* account. Possible values include: 'Small' @@ -301,6 +293,12 @@ static DatabaseAccountCreateUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] public System.Collections.Generic.IList Locations {get; set; } + /// + /// Gets or sets list of IpRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] + public System.Collections.Generic.IList IPRules {get; set; } + /// /// Gets or sets flag to indicate whether to enable/disable Virtual Network ACL /// rules. @@ -430,18 +428,18 @@ static DatabaseAccountCreateUpdateParameters() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -451,13 +449,6 @@ static DatabaseAccountCreateUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets or sets flag to indicate enabling/disabling of Priority Based /// Execution Preview feature on the account @@ -471,8 +462,22 @@ static DatabaseAccountCreateUpdateParameters() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + /// - /// Gets or sets the offer type for the database + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } + /// + /// Gets or sets the offer type for the Cosmos DB database account. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.databaseAccountOfferType")] public static string DatabaseAccountOfferType {get; private set; } @@ -489,7 +494,6 @@ public virtual void Validate() throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Locations"); } - if (this.ConsistencyPolicy != null) { this.ConsistencyPolicy.Validate(); @@ -499,7 +503,6 @@ public virtual void Validate() - if (this.Capacity != null) { this.Capacity.Validate(); @@ -521,6 +524,7 @@ public virtual void Validate() + if (this.Cors != null) { foreach (var element in this.Cors) diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateProperties.cs index d45c4e11cf67..28b405b08459 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdateProperties.cs @@ -121,22 +121,18 @@ public DatabaseAccountCreateUpdateProperties() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// Flag to indicate enabling/disabling of Priority Based Execution Preview /// feature on the account /// @@ -144,7 +140,15 @@ public DatabaseAccountCreateUpdateProperties() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountCreateUpdateProperties(System.Collections.Generic.IList locations, ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string createMode = default(string), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), RestoreParameters restoreParameters = default(RestoreParameters), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) + + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountCreateUpdateProperties(System.Collections.Generic.IList locations, ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string createMode = default(string), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), RestoreParameters restoreParameters = default(RestoreParameters), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) { this.ConsistencyPolicy = consistencyPolicy; @@ -175,12 +179,13 @@ public DatabaseAccountCreateUpdateProperties() this.Capacity = capacity; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } /// @@ -385,18 +390,18 @@ static DatabaseAccountCreateUpdateProperties() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -406,13 +411,6 @@ static DatabaseAccountCreateUpdateProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets or sets flag to indicate enabling/disabling of Priority Based /// Execution Preview feature on the account @@ -426,8 +424,22 @@ static DatabaseAccountCreateUpdateProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } /// - /// Gets or sets the offer type for the database + /// Gets or sets the offer type for the Cosmos DB database account. /// [Newtonsoft.Json.JsonProperty(PropertyName = "databaseAccountOfferType")] public static string DatabaseAccountOfferType {get; private set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType.cs new file mode 100644 index 000000000000..5158b39c624a --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType.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 +{ + + /// + /// Defines values for DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType. + /// + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType + { + [System.Runtime.Serialization.EnumMember(Value = "Standard")] + Standard + } + internal static class DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferTypeEnumExtension + { + internal static string ToSerializedValue(this DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType? value) + { + return value == null ? null : ((DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType)value).ToSerializedValue(); + } + internal static string ToSerializedValue(this DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType value) + { + switch( value ) + { + case DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType.Standard: + return "Standard"; + } + return null; + } + internal static DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType? ParseDatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType(this string value) + { + switch( value ) + { + case "Standard": + return DatabaseAccountCreateUpdatePropertiesDatabaseAccountOfferType.Standard; + } + return null; + } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetProperties.cs index 8196e88db6c5..57663f78f6a0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetProperties.cs @@ -24,14 +24,7 @@ public DatabaseAccountGetProperties() /// Initializes a new instance of the DatabaseAccountGetProperties class. /// - /// The status of the Cosmos DB account at the time the operation was called. - /// The status can be one of following. 'Creating' – the Cosmos DB account is - /// being created. When an account is in Creating state, only properties that - /// are specified as input for the Create Cosmos DB account operation are - /// returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' - /// – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - /// account is being deleted. 'Failed' – the Cosmos DB account failed creation. - /// 'DeletionFailed' – the Cosmos DB account deletion failed. + /// The provisioning state of the resource. /// /// The connection endpoint for the Cosmos DB database account. @@ -152,22 +145,18 @@ public DatabaseAccountGetProperties() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// The version of the Customer Managed Key currently being used by the account /// @@ -178,7 +167,15 @@ public DatabaseAccountGetProperties() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountGetProperties(string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList writeLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList readLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList failoverPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string instanceId = default(string), string createMode = default(string), RestoreParameters restoreParameters = default(RestoreParameters), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), string keyVaultKeyUriVersion = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) + + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountGetProperties(string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountGetPropertiesDatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountGetPropertiesDatabaseAccountOfferType?), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList writeLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList readLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList failoverPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string instanceId = default(string), string createMode = default(string), RestoreParameters restoreParameters = default(RestoreParameters), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), string keyVaultKeyUriVersion = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) { this.ProvisioningState = provisioningState; @@ -217,13 +214,14 @@ public DatabaseAccountGetProperties() this.Capacity = capacity; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.KeyVaultKeyUriVersion = keyVaultKeyUriVersion; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } @@ -234,14 +232,7 @@ public DatabaseAccountGetProperties() /// - /// Gets the status of the Cosmos DB account at the time the operation was - /// called. The status can be one of following. 'Creating' – the Cosmos DB - /// account is being created. When an account is in Creating state, only - /// properties that are specified as input for the Create Cosmos DB account - /// operation are returned. 'Succeeded' – the Cosmos DB account is active for - /// use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the - /// Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed - /// creation. 'DeletionFailed' – the Cosmos DB account deletion failed. + /// Gets the provisioning state of the resource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState {get; private set; } @@ -257,7 +248,7 @@ public DatabaseAccountGetProperties() /// Standard. Possible values include: 'Standard' /// [Newtonsoft.Json.JsonProperty(PropertyName = "databaseAccountOfferType")] - public DatabaseAccountOfferType? DatabaseAccountOfferType {get; private set; } + public DatabaseAccountGetPropertiesDatabaseAccountOfferType? DatabaseAccountOfferType {get; private set; } /// /// Gets or sets list of IpRules. @@ -478,18 +469,18 @@ public DatabaseAccountGetProperties() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -499,13 +490,6 @@ public DatabaseAccountGetProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets the version of the Customer Managed Key currently being used by the /// account @@ -526,6 +510,20 @@ public DatabaseAccountGetProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } /// /// Validate the object. /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountOfferType.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetPropertiesDatabaseAccountOfferType.cs similarity index 56% rename from src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountOfferType.cs rename to src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetPropertiesDatabaseAccountOfferType.cs index c9aa69940dd4..00d7d12f6055 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountOfferType.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetPropertiesDatabaseAccountOfferType.cs @@ -7,37 +7,37 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { /// - /// Defines values for DatabaseAccountOfferType. + /// Defines values for DatabaseAccountGetPropertiesDatabaseAccountOfferType. /// [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum DatabaseAccountOfferType + public enum DatabaseAccountGetPropertiesDatabaseAccountOfferType { [System.Runtime.Serialization.EnumMember(Value = "Standard")] Standard } - internal static class DatabaseAccountOfferTypeEnumExtension + internal static class DatabaseAccountGetPropertiesDatabaseAccountOfferTypeEnumExtension { - internal static string ToSerializedValue(this DatabaseAccountOfferType? value) + internal static string ToSerializedValue(this DatabaseAccountGetPropertiesDatabaseAccountOfferType? value) { - return value == null ? null : ((DatabaseAccountOfferType)value).ToSerializedValue(); + return value == null ? null : ((DatabaseAccountGetPropertiesDatabaseAccountOfferType)value).ToSerializedValue(); } - internal static string ToSerializedValue(this DatabaseAccountOfferType value) + internal static string ToSerializedValue(this DatabaseAccountGetPropertiesDatabaseAccountOfferType value) { switch( value ) { - case DatabaseAccountOfferType.Standard: + case DatabaseAccountGetPropertiesDatabaseAccountOfferType.Standard: return "Standard"; } return null; } - internal static DatabaseAccountOfferType? ParseDatabaseAccountOfferType(this string value) + internal static DatabaseAccountGetPropertiesDatabaseAccountOfferType? ParseDatabaseAccountGetPropertiesDatabaseAccountOfferType(this string value) { switch( value ) { case "Standard": - return DatabaseAccountOfferType.Standard; + return DatabaseAccountGetPropertiesDatabaseAccountOfferType.Standard; } return null; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetResults.cs index 2a9275ed2d30..0ff4ea82e001 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB database account. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class DatabaseAccountGetResults : ARMResourceProperties + public partial class DatabaseAccountGetResults : Resource { /// /// Initializes a new instance of the DatabaseAccountGetResults class. @@ -25,49 +25,33 @@ public DatabaseAccountGetResults() /// Initializes a new instance of the DatabaseAccountGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. /// - /// Indicates the type of database account. This can only be set at database - /// account creation. - /// Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - - /// Identity for the resource. - /// - - /// The system meta data relating to this resource. + /// The geo-location where the resource lives /// - /// The status of the Cosmos DB account at the time the operation was called. - /// The status can be one of following. 'Creating' – the Cosmos DB account is - /// being created. When an account is in Creating state, only properties that - /// are specified as input for the Create Cosmos DB account operation are - /// returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' - /// – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - /// account is being deleted. 'Failed' – the Cosmos DB account failed creation. - /// 'DeletionFailed' – the Cosmos DB account deletion failed. + /// Identity for the resource. /// - /// List of IpRules. - /// + /// Indicates the type of database account. This can only be set at database + /// account creation. + /// Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' /// The consistency policy for the Cosmos DB database account. /// @@ -91,12 +75,18 @@ public DatabaseAccountGetResults() /// on an account. /// + /// The provisioning state of the resource. + /// + /// The connection endpoint for the Cosmos DB database account. /// /// The offer type for the Cosmos DB database account. Default value: Standard. /// Possible values include: 'Standard' + /// List of IpRules. + /// + /// Flag to indicate whether to enable/disable Virtual Network ACL rules. /// @@ -184,22 +174,18 @@ public DatabaseAccountGetResults() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// The version of the Customer Managed Key currently being used by the account /// @@ -210,15 +196,22 @@ public DatabaseAccountGetResults() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SystemData systemData = default(SystemData), string provisioningState = default(string), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), string createMode = default(string), RestoreParameters restoreParameters = default(RestoreParameters), BackupPolicy backupPolicy = default(BackupPolicy), Capacity capacity = default(Capacity), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList writeLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList readLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList failoverPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string instanceId = default(string), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), string keyVaultKeyUriVersion = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) - : base(id, name, type, location, tags) + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string kind = default(string), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), string createMode = default(string), RestoreParameters restoreParameters = default(RestoreParameters), BackupPolicy backupPolicy = default(BackupPolicy), Capacity capacity = default(Capacity), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountGetPropertiesDatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountGetPropertiesDatabaseAccountOfferType?), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList writeLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList readLocations = default(System.Collections.Generic.IList), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList failoverPolicies = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), System.Collections.Generic.IList privateEndpointConnections = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string instanceId = default(string), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), string keyVaultKeyUriVersion = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) + + : base(id, name, type, systemData) { - this.Kind = kind; + this.Tags = tags; + this.Location = location; this.Identity = identity; - this.SystemData = systemData; - this.ProvisioningState = provisioningState; - this.IPRules = ipRules; + this.Kind = kind; this.ConsistencyPolicy = consistencyPolicy; this.ConnectorOffer = connectorOffer; this.ApiProperties = apiProperties; @@ -226,8 +219,10 @@ public DatabaseAccountGetResults() this.RestoreParameters = restoreParameters; this.BackupPolicy = backupPolicy; this.Capacity = capacity; + this.ProvisioningState = provisioningState; this.DocumentEndpoint = documentEndpoint; this.DatabaseAccountOfferType = databaseAccountOfferType; + this.IPRules = ipRules; this.IsVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; this.EnableAutomaticFailover = enableAutomaticFailover; this.Capabilities = capabilities; @@ -253,13 +248,14 @@ public DatabaseAccountGetResults() this.DisableLocalAuth = disableLocalAuth; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.KeyVaultKeyUriVersion = keyVaultKeyUriVersion; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } @@ -270,42 +266,29 @@ public DatabaseAccountGetResults() /// - /// Gets or sets indicates the type of database account. This can only be set - /// at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] - public string Kind {get; set; } - - /// - /// Gets or sets identity for the resource. + /// Gets or sets resource tags. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] - public ManagedServiceIdentity Identity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// - /// Gets the system meta data relating to this resource. + /// Gets or sets the geo-location where the resource lives /// - [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] - public SystemData SystemData {get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// - /// Gets the status of the Cosmos DB account at the time the operation was - /// called. The status can be one of following. 'Creating' – the Cosmos DB - /// account is being created. When an account is in Creating state, only - /// properties that are specified as input for the Create Cosmos DB account - /// operation are returned. 'Succeeded' – the Cosmos DB account is active for - /// use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the - /// Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed - /// creation. 'DeletionFailed' – the Cosmos DB account deletion failed. + /// Gets or sets identity for the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } /// - /// Gets or sets list of IpRules. + /// Gets or sets indicates the type of database account. This can only be set + /// at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] - public System.Collections.Generic.IList IPRules {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "kind")] + public string Kind {get; set; } /// /// Gets or sets the consistency policy for the Cosmos DB database account. @@ -352,6 +335,12 @@ public DatabaseAccountGetResults() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.capacity")] public Capacity Capacity {get; set; } + /// + /// Gets the provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + /// /// Gets the connection endpoint for the Cosmos DB database account. /// @@ -363,7 +352,13 @@ public DatabaseAccountGetResults() /// Standard. Possible values include: 'Standard' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.databaseAccountOfferType")] - public DatabaseAccountOfferType? DatabaseAccountOfferType {get; private set; } + public DatabaseAccountGetPropertiesDatabaseAccountOfferType? DatabaseAccountOfferType {get; private set; } + + /// + /// Gets or sets list of IpRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] + public System.Collections.Generic.IList IPRules {get; set; } /// /// Gets or sets flag to indicate whether to enable/disable Virtual Network ACL @@ -533,18 +528,18 @@ public DatabaseAccountGetResults() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -554,13 +549,6 @@ public DatabaseAccountGetResults() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets the version of the Customer Managed Key currently being used by the /// account @@ -581,6 +569,20 @@ public DatabaseAccountGetResults() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } /// /// Validate the object. /// @@ -593,7 +595,6 @@ public virtual void Validate() - if (this.ConsistencyPolicy != null) { this.ConsistencyPolicy.Validate(); @@ -610,6 +611,8 @@ public virtual void Validate() + + if (this.WriteLocations != null) { foreach (var element in this.WriteLocations) diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateParameters.cs index 07ec5b73a4d6..027044193d64 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateParameters.cs @@ -43,9 +43,6 @@ public DatabaseAccountUpdateParameters() /// The consistency policy for the Cosmos DB account. /// - /// List of IpRules. - /// - /// The cassandra connector offer type for the Cosmos DB database C* account. /// Possible values include: 'Small' @@ -63,6 +60,9 @@ public DatabaseAccountUpdateParameters() /// DB account. /// + /// List of IpRules. + /// + /// Flag to indicate whether to enable/disable Virtual Network ACL rules. /// @@ -131,22 +131,18 @@ public DatabaseAccountUpdateParameters() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// Flag to indicate enabling/disabling of Priority Based Execution Preview /// feature on the account /// @@ -154,19 +150,27 @@ public DatabaseAccountUpdateParameters() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountUpdateParameters(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), BackupPolicy backupPolicy = default(BackupPolicy), Capacity capacity = default(Capacity), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) + + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountUpdateParameters(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), string connectorOffer = default(string), ApiProperties apiProperties = default(ApiProperties), BackupPolicy backupPolicy = default(BackupPolicy), Capacity capacity = default(Capacity), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) { this.Tags = tags; this.Location = location; this.Identity = identity; this.ConsistencyPolicy = consistencyPolicy; - this.IPRules = ipRules; this.ConnectorOffer = connectorOffer; this.ApiProperties = apiProperties; this.BackupPolicy = backupPolicy; this.Capacity = capacity; this.Locations = locations; + this.IPRules = ipRules; this.IsVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; this.EnableAutomaticFailover = enableAutomaticFailover; this.Capabilities = capabilities; @@ -186,12 +190,13 @@ public DatabaseAccountUpdateParameters() this.DisableLocalAuth = disableLocalAuth; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } @@ -233,12 +238,6 @@ public DatabaseAccountUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.consistencyPolicy")] public ConsistencyPolicy ConsistencyPolicy {get; set; } - /// - /// Gets or sets list of IpRules. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] - public System.Collections.Generic.IList IPRules {get; set; } - /// /// Gets or sets the cassandra connector offer type for the Cosmos DB database /// C* account. Possible values include: 'Small' @@ -274,6 +273,12 @@ public DatabaseAccountUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.locations")] public System.Collections.Generic.IList Locations {get; set; } + /// + /// Gets or sets list of IpRules. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.ipRules")] + public System.Collections.Generic.IList IPRules {get; set; } + /// /// Gets or sets flag to indicate whether to enable/disable Virtual Network ACL /// rules. @@ -403,18 +408,18 @@ public DatabaseAccountUpdateParameters() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -424,13 +429,6 @@ public DatabaseAccountUpdateParameters() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets or sets flag to indicate enabling/disabling of Priority Based /// Execution Preview feature on the account @@ -444,6 +442,20 @@ public DatabaseAccountUpdateParameters() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } /// /// Validate the object. /// @@ -462,7 +474,6 @@ public virtual void Validate() - if (this.Capacity != null) { this.Capacity.Validate(); @@ -483,6 +494,7 @@ public virtual void Validate() + if (this.Cors != null) { foreach (var element in this.Cors) diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateProperties.cs index 87303ca8b4b7..3c69527c6500 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountUpdateProperties.cs @@ -115,22 +115,18 @@ public DatabaseAccountUpdateProperties() /// account /// - /// Indicates the minimum allowed Tls version. The default value is Tls 1.2. - /// Cassandra and Mongo APIs only work with Tls 1.2. - /// Possible values include: 'Tls', 'Tls11', 'Tls12' - - /// Flag to indicate enabling/disabling of Burst Capacity feature on the - /// account + /// Flag to indicate enabling/disabling of Burst Capacity Preview feature on + /// the account /// + /// Indicates the minimum allowed Tls version. The default is Tls 1.0, except + /// for Cassandra and Mongo API's, which only work with Tls 1.2. + /// Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Indicates the status of the Customer Managed Key feature on the account. In /// case there are errors, the property provides troubleshooting guidance. /// - /// Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale - /// feature on the account - /// - /// Flag to indicate enabling/disabling of Priority Based Execution Preview /// feature on the account /// @@ -138,7 +134,15 @@ public DatabaseAccountUpdateProperties() /// Enum to indicate default Priority Level of request for Priority Based /// Execution. /// Possible values include: 'High', 'Low' - public DatabaseAccountUpdateProperties(ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), string minimalTlsVersion = default(string), bool? enableBurstCapacity = default(bool?), string customerManagedKeyStatus = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string)) + + /// Flag to indicate enabling/disabling of Per-Region Per-partition autoscale + /// Preview feature on the account + /// + + /// Flag to indicate enabling/disabling of hierarchical partition key ID last + /// level enforcement on the account. + /// + public DatabaseAccountUpdateProperties(ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), System.Collections.Generic.IList locations = default(System.Collections.Generic.IList), System.Collections.Generic.IList ipRules = default(System.Collections.Generic.IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IList capabilities = default(System.Collections.Generic.IList), System.Collections.Generic.IList virtualNetworkRules = default(System.Collections.Generic.IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), BackupPolicy backupPolicy = default(BackupPolicy), System.Collections.Generic.IList cors = default(System.Collections.Generic.IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), System.Collections.Generic.IList networkAclBypassResourceIds = default(System.Collections.Generic.IList), bool? disableLocalAuth = default(bool?), Capacity capacity = default(Capacity), DatabaseAccountKeysMetadata keysMetadata = default(DatabaseAccountKeysMetadata), bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), string minimalTlsVersion = default(string), string customerManagedKeyStatus = default(string), bool? enablePriorityBasedExecution = default(bool?), string defaultPriorityLevel = default(string), bool? enablePerRegionPerPartitionAutoscale = default(bool?), bool? enforceHierarchicalPartitionKeyIdLastLevel = default(bool?)) { this.ConsistencyPolicy = consistencyPolicy; @@ -167,12 +171,13 @@ public DatabaseAccountUpdateProperties() this.Capacity = capacity; this.KeysMetadata = keysMetadata; this.EnablePartitionMerge = enablePartitionMerge; - this.MinimalTlsVersion = minimalTlsVersion; this.EnableBurstCapacity = enableBurstCapacity; + this.MinimalTlsVersion = minimalTlsVersion; this.CustomerManagedKeyStatus = customerManagedKeyStatus; - this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; this.EnablePriorityBasedExecution = enablePriorityBasedExecution; this.DefaultPriorityLevel = defaultPriorityLevel; + this.EnablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + this.EnforceHierarchicalPartitionKeyIdLastLevel = enforceHierarchicalPartitionKeyIdLastLevel; CustomInit(); } @@ -358,18 +363,18 @@ public DatabaseAccountUpdateProperties() public bool? EnablePartitionMerge {get; set; } /// - /// Gets or sets indicates the minimum allowed Tls version. The default value - /// is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' + /// Gets or sets flag to indicate enabling/disabling of Burst Capacity Preview + /// feature on the account /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] - public string MinimalTlsVersion {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] + public bool? EnableBurstCapacity {get; set; } /// - /// Gets or sets flag to indicate enabling/disabling of Burst Capacity feature - /// on the account + /// Gets or sets indicates the minimum allowed Tls version. The default is Tls + /// 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Possible values include: 'Tls', 'Tls11', 'Tls12' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enableBurstCapacity")] - public bool? EnableBurstCapacity {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "minimalTlsVersion")] + public string MinimalTlsVersion {get; set; } /// /// Gets or sets indicates the status of the Customer Managed Key feature on @@ -379,13 +384,6 @@ public DatabaseAccountUpdateProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "customerManagedKeyStatus")] public string CustomerManagedKeyStatus {get; set; } - /// - /// Gets or sets flag to indicate enabling/disabling of - /// PerRegionPerPartitionAutoscale feature on the account - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] - public bool? EnablePerRegionPerPartitionAutoscale {get; set; } - /// /// Gets or sets flag to indicate enabling/disabling of Priority Based /// Execution Preview feature on the account @@ -399,6 +397,20 @@ public DatabaseAccountUpdateProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "defaultPriorityLevel")] public string DefaultPriorityLevel {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of Per-Region + /// Per-partition autoscale Preview feature on the account + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enablePerRegionPerPartitionAutoscale")] + public bool? EnablePerRegionPerPartitionAutoscale {get; set; } + + /// + /// Gets or sets flag to indicate enabling/disabling of hierarchical partition + /// key ID last level enforcement on the account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enforceHierarchicalPartitionKeyIdLastLevel")] + public bool? EnforceHierarchicalPartitionKeyIdLastLevel {get; set; } /// /// Validate the object. /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsCreateOrUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..780832284d38 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsCreateOrUpdateHeaders.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 DatabaseAccountsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the DatabaseAccountsCreateOrUpdateHeaders class. + /// + public DatabaseAccountsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabaseAccountsCreateOrUpdateHeaders class. + /// + + /// + /// + public DatabaseAccountsCreateOrUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsDeleteHeaders.cs index 6fa200dc263d..91758d2a4380 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsDeleteHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsDeleteHeaders.cs @@ -43,13 +43,13 @@ public DatabaseAccountsDeleteHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsFailoverPriorityChangeHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsFailoverPriorityChangeHeaders.cs index d3bebc59f2a8..d3851992f6a7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsFailoverPriorityChangeHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsFailoverPriorityChangeHeaders.cs @@ -26,11 +26,15 @@ public DatabaseAccountsFailoverPriorityChangeHeaders() /// /// - public DatabaseAccountsFailoverPriorityChangeHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public DatabaseAccountsFailoverPriorityChangeHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public DatabaseAccountsFailoverPriorityChangeHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOfflineRegionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOfflineRegionHeaders.cs index df2b18093bd1..24d1a242e79e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOfflineRegionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOfflineRegionHeaders.cs @@ -26,11 +26,15 @@ public DatabaseAccountsOfflineRegionHeaders() /// /// - public DatabaseAccountsOfflineRegionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public DatabaseAccountsOfflineRegionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public DatabaseAccountsOfflineRegionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOnlineRegionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOnlineRegionHeaders.cs index dd1c3cef1b12..6ae5c1f2b339 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOnlineRegionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsOnlineRegionHeaders.cs @@ -26,11 +26,15 @@ public DatabaseAccountsOnlineRegionHeaders() /// /// - public DatabaseAccountsOnlineRegionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public DatabaseAccountsOnlineRegionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public DatabaseAccountsOnlineRegionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsRegenerateKeyHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsRegenerateKeyHeaders.cs index 0653cb7a5249..d94d550a3597 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsRegenerateKeyHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsRegenerateKeyHeaders.cs @@ -26,11 +26,15 @@ public DatabaseAccountsRegenerateKeyHeaders() /// /// - public DatabaseAccountsRegenerateKeyHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public DatabaseAccountsRegenerateKeyHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public DatabaseAccountsRegenerateKeyHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsUpdateHeaders.cs new file mode 100644 index 000000000000..fa1fafeeec7a --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/DatabaseAccountsUpdateHeaders.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 DatabaseAccountsUpdateHeaders + { + /// + /// Initializes a new instance of the DatabaseAccountsUpdateHeaders class. + /// + public DatabaseAccountsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DatabaseAccountsUpdateHeaders class. + /// + + /// + /// + public DatabaseAccountsUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs deleted file mode 100644 index fbda4bebda64..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs +++ /dev/null @@ -1,88 +0,0 @@ -// 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; - - /// - /// The error detail. - /// - public partial class ErrorDetailAutoGenerated - { - /// - /// Initializes a new instance of the ErrorDetailAutoGenerated class. - /// - public ErrorDetailAutoGenerated() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorDetailAutoGenerated class. - /// - - /// The error code. - /// - - /// The error message. - /// - - /// The error target. - /// - - /// The error details. - /// - - /// The error additional info. - /// - public ErrorDetailAutoGenerated(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) - - { - this.Code = code; - this.Message = message; - this.Target = target; - this.Details = details; - this.AdditionalInfo = additionalInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets the error code. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] - public string Code {get; private set; } - - /// - /// Gets the error message. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] - public string Message {get; private set; } - - /// - /// Gets the error target. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "target")] - public string Target {get; private set; } - - /// - /// Gets the error details. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "details")] - public System.Collections.Generic.IList Details {get; private set; } - - /// - /// Gets the error additional info. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] - public System.Collections.Generic.IList AdditionalInfo {get; private set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponse.cs index 32a763bf9cc4..90afe9ccc9f5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -8,8 +8,15 @@ namespace Microsoft.Azure.Management.CosmosDB.Models using System.Linq; /// - /// Error Response. + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). /// + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// public partial class ErrorResponse { /// @@ -24,16 +31,12 @@ public ErrorResponse() /// Initializes a new instance of the ErrorResponse class. /// - /// Error code. + /// The error object. /// - - /// Error message indicating why the operation failed. - /// - public ErrorResponse(string code = default(string), string message = default(string)) + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - this.Code = code; - this.Message = message; + this.Error = error; CustomInit(); } @@ -44,15 +47,9 @@ public ErrorResponse() /// - /// Gets or sets error code. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "code")] - public string Code {get; set; } - - /// - /// Gets or sets error message indicating why the operation failed. + /// Gets or sets the error object. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "message")] - public string Message {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs index f3844d2d79c6..eeaa035456e9 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs @@ -8,15 +8,8 @@ namespace Microsoft.Azure.Management.CosmosDB.Models using System.Linq; /// - /// Common error response for all Azure Resource Manager APIs to return error - /// details for failed operations. (This also follows the OData error response - /// format.). + /// Error Response. /// - /// - /// Common error response for all Azure Resource Manager APIs to return error - /// details for failed operations. (This also follows the OData error response - /// format.). - /// public partial class ErrorResponseAutoGenerated { /// @@ -31,12 +24,16 @@ public ErrorResponseAutoGenerated() /// Initializes a new instance of the ErrorResponseAutoGenerated class. /// - /// The error object. + /// Error code. /// - public ErrorResponseAutoGenerated(ErrorDetail error = default(ErrorDetail)) + + /// Error message indicating why the operation failed. + /// + public ErrorResponseAutoGenerated(string code = default(string), string message = default(string)) { - this.Error = error; + this.Code = code; + this.Message = message; CustomInit(); } @@ -47,9 +44,15 @@ public ErrorResponseAutoGenerated() /// - /// Gets or sets the error object. + /// Gets or sets error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets error message indicating why the operation failed. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "error")] - public ErrorDetail Error {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs deleted file mode 100644 index 0f0a1bcdbc5c..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs +++ /dev/null @@ -1,55 +0,0 @@ -// 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; - - /// - /// Common error response for all Azure Resource Manager APIs to return error - /// details for failed operations. (This also follows the OData error response - /// format.). - /// - /// - /// Common error response for all Azure Resource Manager APIs to return error - /// details for failed operations. (This also follows the OData error response - /// format.). - /// - public partial class ErrorResponseAutoGenerated2 - { - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. - /// - public ErrorResponseAutoGenerated2() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. - /// - - /// The error object. - /// - public ErrorResponseAutoGenerated2(ErrorDetailAutoGenerated error = default(ErrorDetailAutoGenerated)) - - { - this.Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets the error object. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "error")] - public ErrorDetailAutoGenerated Error {get; set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.cs deleted file mode 100644 index 6e508bbc4e25..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.cs +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -{ - - /// - /// Exception thrown for an invalid response with ErrorResponseAutoGenerated2 information. - /// - public partial class ErrorResponseAutoGenerated2Exception : Microsoft.Rest.RestException - { - /// - /// Gets information about the associated HTTP request. - /// - public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } - - /// - /// Gets information about the associated HTTP response. - /// - public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } - - /// - /// Gets or sets the body object. - /// - public ErrorResponseAutoGenerated2 Body { get; set; } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated2Exception class. - /// - public ErrorResponseAutoGenerated2Exception() - { - } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. - /// - /// The exception message. - public ErrorResponseAutoGenerated2Exception(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. - /// - /// The exception message. - /// Inner exception. - public ErrorResponseAutoGenerated2Exception(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs deleted file mode 100644 index c54334314fae..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -{ - - /// - /// Exception thrown for an invalid response with ErrorResponseAutoGenerated information. - /// - public partial class ErrorResponseAutoGeneratedException : Microsoft.Rest.RestException - { - /// - /// Gets information about the associated HTTP request. - /// - public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } - - /// - /// Gets information about the associated HTTP response. - /// - public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } - - /// - /// Gets or sets the body object. - /// - public ErrorResponseAutoGenerated Body { get; set; } - - /// - /// Initializes a new instance of the ErrorResponseAutoGeneratedException class. - /// - public ErrorResponseAutoGeneratedException() - { - } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated class. - /// - /// The exception message. - public ErrorResponseAutoGeneratedException(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the ErrorResponseAutoGenerated class. - /// - /// The exception message. - /// Inner exception. - public ErrorResponseAutoGeneratedException(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ExtendedResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ExtendedResourceProperties.cs deleted file mode 100644 index 7433f27e6907..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ExtendedResourceProperties.cs +++ /dev/null @@ -1,73 +0,0 @@ -// 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; - - /// - /// The system generated resource properties associated with SQL databases, SQL - /// containers, Gremlin databases and Gremlin graphs. - /// - public partial class ExtendedResourceProperties - { - /// - /// Initializes a new instance of the ExtendedResourceProperties class. - /// - public ExtendedResourceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExtendedResourceProperties class. - /// - - /// A system generated property. A unique identifier. - /// - - /// A system generated property that denotes the last updated timestamp of the - /// resource. - /// - - /// A system generated property representing the resource etag required for - /// optimistic concurrency control. - /// - public ExtendedResourceProperties(string rid = default(string), double? ts = default(double?), string etag = default(string)) - - { - this.Rid = rid; - this.Ts = ts; - this.Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets a system generated property. A unique identifier. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "_rid")] - public string Rid {get; private set; } - - /// - /// Gets a system generated property that denotes the last updated timestamp of - /// the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "_ts")] - public double? Ts {get; private set; } - - /// - /// Gets a system generated property representing the resource etag required - /// for optimistic concurrency control. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "_etag")] - public string Etag {get; private set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetDeleteHeaders.cs index c196c106c856..0b427b013a52 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetDeleteHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetDeleteHeaders.cs @@ -26,11 +26,15 @@ public FleetDeleteHeaders() /// /// - public FleetDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public FleetDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public FleetDeleteHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResource.cs index 8167074580ff..fe6b70534952 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResource.cs @@ -48,8 +48,8 @@ public FleetResource() /// A provisioning state of the Fleet. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' public FleetResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string provisioningState = default(string)) : base(location, id, name, type, systemData, tags) @@ -65,10 +65,10 @@ public FleetResource() /// - /// Gets or sets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Validate the object. /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceProperties.cs index 79cd91afc5c5..7d0c3ddbf983 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceProperties.cs @@ -26,8 +26,8 @@ public FleetResourceProperties() /// A provisioning state of the Fleet. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' public FleetResourceProperties(string provisioningState = default(string)) { @@ -42,9 +42,9 @@ public FleetResourceProperties() /// - /// Gets or sets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceUpdate.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceUpdate.cs index a212157bb27e..81e8b76eea1e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceUpdate.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetResourceUpdate.cs @@ -27,8 +27,8 @@ public FleetResourceUpdate() /// A provisioning state of the Fleet. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' public FleetResourceUpdate(string provisioningState = default(string)) { @@ -43,9 +43,9 @@ public FleetResourceUpdate() /// - /// Gets or sets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleet. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountCreateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountCreateHeaders.cs new file mode 100644 index 000000000000..d6471480842d --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountCreateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 FleetspaceAccountCreateHeaders + { + /// + /// Initializes a new instance of the FleetspaceAccountCreateHeaders class. + /// + public FleetspaceAccountCreateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FleetspaceAccountCreateHeaders class. + /// + + /// + /// + + /// + /// + public FleetspaceAccountCreateHeaders(string azureAsyncOperation = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountDeleteHeaders.cs index 1131d3f18e00..43401958f5f3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountDeleteHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountDeleteHeaders.cs @@ -26,11 +26,15 @@ public FleetspaceAccountDeleteHeaders() /// /// - public FleetspaceAccountDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public FleetspaceAccountDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public FleetspaceAccountDeleteHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountProperties.cs index d69a88156f96..1b7f7af6a1bc 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountProperties.cs @@ -27,8 +27,8 @@ public FleetspaceAccountProperties() /// A provisioning state of the Fleetspace Account. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' /// Configuration for fleetspace Account in the fleetspace. /// @@ -47,10 +47,10 @@ public FleetspaceAccountProperties() /// - /// Gets or sets a provisioning state of the Fleetspace Account. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleetspace Account. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Gets or sets configuration for fleetspace Account in the fleetspace. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountResource.cs index 61bdb05ffab8..113ff97adef7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceAccountResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Fleetspace Account /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class FleetspaceAccountResource : ProxyResourceAutoGenerated + public partial class FleetspaceAccountResource : ProxyResource { /// /// Initializes a new instance of the FleetspaceAccountResource class. @@ -42,8 +42,8 @@ public FleetspaceAccountResource() /// A provisioning state of the Fleetspace Account. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' /// Configuration for fleetspace Account in the fleetspace. /// @@ -63,10 +63,10 @@ public FleetspaceAccountResource() /// - /// Gets or sets a provisioning state of the Fleetspace Account. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleetspace Account. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Gets or sets configuration for fleetspace Account in the fleetspace. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceCreateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceCreateHeaders.cs new file mode 100644 index 000000000000..39a3ddaca5ed --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceCreateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 FleetspaceCreateHeaders + { + /// + /// Initializes a new instance of the FleetspaceCreateHeaders class. + /// + public FleetspaceCreateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FleetspaceCreateHeaders class. + /// + + /// + /// + + /// + /// + public FleetspaceCreateHeaders(string azureAsyncOperation = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceDeleteHeaders.cs index 730ee56390e1..5a6cfb515bd3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceDeleteHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceDeleteHeaders.cs @@ -26,11 +26,15 @@ public FleetspaceDeleteHeaders() /// /// - public FleetspaceDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public FleetspaceDeleteHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public FleetspaceDeleteHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceProperties.cs index f6cab25fc9e0..cbd4e5bd529b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceProperties.cs @@ -26,8 +26,8 @@ public FleetspaceProperties() /// A provisioning state of the Fleetspace. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL' /// Possible values include: 'NoSQL' @@ -60,10 +60,10 @@ public FleetspaceProperties() /// - /// Gets or sets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Gets or sets the kind of API this fleetspace belongs to. Acceptable values: diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs index cced2ca5b02e..23d0f5a09c61 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspacePropertiesThroughputPoolConfiguration.cs @@ -29,11 +29,24 @@ public FleetspacePropertiesThroughputPoolConfiguration() /// Maximum throughput for the pool. /// - public FleetspacePropertiesThroughputPoolConfiguration(int? minThroughput = default(int?), int? maxThroughput = default(int?)) + + /// Total dedicated throughput (RU/s) for fleetspace. Represents the sum of all + /// manual provisioned throughput and all autoscale max RU/s across all shared + /// throughput databases and dedicated throughput containers across all + /// accounts in the fleetspace for 1 region. + /// + + /// Maximum consumable throughput (RU/s) for fleetspace. Represents the maximum + /// throughput that resources in the fleetspace can consume from the + /// fleetspace's pool in 1 region. + /// + public FleetspacePropertiesThroughputPoolConfiguration(int? minThroughput = default(int?), int? maxThroughput = default(int?), long? dedicatedRUs = default(long?), long? maxConsumableRUs = default(long?)) { this.MinThroughput = minThroughput; this.MaxThroughput = maxThroughput; + this.DedicatedRUs = dedicatedRUs; + this.MaxConsumableRUs = maxConsumableRUs; CustomInit(); } @@ -54,5 +67,22 @@ public FleetspacePropertiesThroughputPoolConfiguration() /// [Newtonsoft.Json.JsonProperty(PropertyName = "maxThroughput")] public int? MaxThroughput {get; set; } + + /// + /// Gets or sets total dedicated throughput (RU/s) for fleetspace. Represents + /// the sum of all manual provisioned throughput and all autoscale max RU/s + /// across all shared throughput databases and dedicated throughput containers + /// across all accounts in the fleetspace for 1 region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dedicatedRUs")] + public long? DedicatedRUs {get; set; } + + /// + /// Gets or sets maximum consumable throughput (RU/s) for fleetspace. + /// Represents the maximum throughput that resources in the fleetspace can + /// consume from the fleetspace's pool in 1 region. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maxConsumableRUs")] + public long? MaxConsumableRUs {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceResource.cs index e3309f6eb8e2..683c6dbff345 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Fleetspace. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class FleetspaceResource : ProxyResourceAutoGenerated + public partial class FleetspaceResource : ProxyResource { /// /// Initializes a new instance of the FleetspaceResource class. @@ -42,8 +42,8 @@ public FleetspaceResource() /// A provisioning state of the Fleetspace. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL' /// Possible values include: 'NoSQL' @@ -77,10 +77,10 @@ public FleetspaceResource() /// - /// Gets or sets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Gets or sets the kind of API this fleetspace belongs to. Acceptable values: diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdate.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdate.cs index 5a14afd98a09..86174363fb65 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdate.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdate.cs @@ -27,8 +27,8 @@ public FleetspaceUpdate() /// A provisioning state of the Fleetspace. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' /// The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL' /// Possible values include: 'NoSQL' @@ -61,10 +61,10 @@ public FleetspaceUpdate() /// - /// Gets or sets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets a provisioning state of the Fleetspace. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState {get; set; } + public string ProvisioningState {get; private set; } /// /// Gets or sets the kind of API this fleetspace belongs to. Acceptable values: diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdateHeaders.cs index a66220d5da15..45074a134d1b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdateHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/FleetspaceUpdateHeaders.cs @@ -26,11 +26,15 @@ public FleetspaceUpdateHeaders() /// /// - public FleetspaceUpdateHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public FleetspaceUpdateHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public FleetspaceUpdateHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GraphAPIComputeServiceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GraphAPIComputeServiceResource.cs deleted file mode 100644 index f903ae7a7b81..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GraphAPIComputeServiceResource.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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; - - /// - /// Describes the service response property for GraphAPICompute. - /// - public partial class GraphAPIComputeServiceResource - { - /// - /// Initializes a new instance of the GraphAPIComputeServiceResource class. - /// - public GraphAPIComputeServiceResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GraphAPIComputeServiceResource class. - /// - - /// Properties for GraphAPIComputeServiceResource. - /// - public GraphAPIComputeServiceResource(GraphAPIComputeServiceResourceProperties properties = default(GraphAPIComputeServiceResourceProperties)) - - { - this.Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets properties for GraphAPIComputeServiceResource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public GraphAPIComputeServiceResourceProperties Properties {get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.Properties != null) - { - this.Properties.Validate(); - } - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs index fd7ef43653ab..4845f2fee33a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public GremlinDatabaseCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a Gremlin database /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public GremlinDatabaseCreateUpdateParameters(GremlinDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public GremlinDatabaseCreateUpdateParameters(GremlinDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetPropertiesResource.cs index 9bb14a97d039..3a3840f03016 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class GremlinDatabaseGetPropertiesResource + public partial class GremlinDatabaseGetPropertiesResource : GremlinDatabaseResource { /// /// Initializes a new instance of the GremlinDatabaseGetPropertiesResource class. @@ -42,10 +42,8 @@ public GremlinDatabaseGetPropertiesResource() /// public GremlinDatabaseGetPropertiesResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, restoreParameters, createMode) { - this.Id = id; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -58,24 +56,6 @@ public GremlinDatabaseGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB Gremlin database - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -101,15 +81,9 @@ public GremlinDatabaseGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetResults.cs index c700ca8550a1..34a681c842dd 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinDatabaseGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Gremlin database. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class GremlinDatabaseGetResults : ARMResourceProperties + public partial class GremlinDatabaseGetResults : Resource { /// /// Initializes a new instance of the GremlinDatabaseGetResults class. @@ -25,25 +25,28 @@ public GremlinDatabaseGetResults() /// Initializes a new instance of the GremlinDatabaseGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public GremlinDatabaseGetResults() /// /// - public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource), GremlinDatabaseGetPropertiesOptions options = default(GremlinDatabaseGetPropertiesOptions)) + public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource), GremlinDatabaseGetPropertiesOptions options = default(GremlinDatabaseGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public GremlinDatabaseGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public GremlinDatabaseGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphCreateUpdateParameters.cs index 4b06bf0eed08..fe62d7c6a628 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public GremlinGraphCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a Gremlin graph /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public GremlinGraphCreateUpdateParameters(GremlinGraphResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public GremlinGraphCreateUpdateParameters(GremlinGraphResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetPropertiesResource.cs index 086224e28daf..1e27a1ccd5ab 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class GremlinGraphGetPropertiesResource + public partial class GremlinGraphGetPropertiesResource : GremlinGraphResource { /// /// Initializes a new instance of the GremlinGraphGetPropertiesResource class. @@ -63,16 +63,8 @@ public GremlinGraphGetPropertiesResource() /// public GremlinGraphGetPropertiesResource(string id, IndexingPolicy indexingPolicy = default(IndexingPolicy), ContainerPartitionKey partitionKey = default(ContainerPartitionKey), int? defaultTtl = default(int?), UniqueKeyPolicy uniqueKeyPolicy = default(UniqueKeyPolicy), ConflictResolutionPolicy conflictResolutionPolicy = default(ConflictResolutionPolicy), long? analyticalStorageTtl = default(long?), ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, analyticalStorageTtl, restoreParameters, createMode) { - this.Id = id; - this.IndexingPolicy = indexingPolicy; - this.PartitionKey = partitionKey; - this.DefaultTtl = defaultTtl; - this.UniqueKeyPolicy = uniqueKeyPolicy; - this.ConflictResolutionPolicy = conflictResolutionPolicy; - this.AnalyticalStorageTtl = analyticalStorageTtl; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -85,63 +77,6 @@ public GremlinGraphGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB Gremlin graph - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets the configuration of the indexing policy. By default, the - /// indexing is automatic for all document paths within the graph - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "indexingPolicy")] - public IndexingPolicy IndexingPolicy {get; set; } - - /// - /// Gets or sets the configuration of the partition key to be used for - /// partitioning data into multiple partitions - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "partitionKey")] - public ContainerPartitionKey PartitionKey {get; set; } - - /// - /// Gets or sets default time to live - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultTtl")] - public int? DefaultTtl {get; set; } - - /// - /// Gets or sets the unique key policy configuration for specifying uniqueness - /// constraints on documents in the collection in the Azure Cosmos DB service. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueKeyPolicy")] - public UniqueKeyPolicy UniqueKeyPolicy {get; set; } - - /// - /// Gets or sets the conflict resolution policy for the graph. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "conflictResolutionPolicy")] - public ConflictResolutionPolicy ConflictResolutionPolicy {get; set; } - - /// - /// Gets or sets analytical TTL. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "analyticalStorageTtl")] - public long? AnalyticalStorageTtl {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -167,22 +102,9 @@ public GremlinGraphGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - if (this.PartitionKey != null) - { - this.PartitionKey.Validate(); - } - - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetResults.cs index 863d043d68fb..7ce10a2304e4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinGraphGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Gremlin graph. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class GremlinGraphGetResults : ARMResourceProperties + public partial class GremlinGraphGetResults : Resource { /// /// Initializes a new instance of the GremlinGraphGetResults class. @@ -25,25 +25,28 @@ public GremlinGraphGetResults() /// Initializes a new instance of the GremlinGraphGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public GremlinGraphGetResults() /// /// - public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource), GremlinGraphGetPropertiesOptions options = default(GremlinGraphGetPropertiesOptions)) + public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource), GremlinGraphGetPropertiesOptions options = default(GremlinGraphGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public GremlinGraphGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public GremlinGraphGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinDatabaseHeaders.cs index 089e07284b42..4f5996e8d3fa 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinDatabaseHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesCreateUpdateGremlinDatabaseHeaders() /// /// - public GremlinResourcesCreateUpdateGremlinDatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesCreateUpdateGremlinDatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesCreateUpdateGremlinDatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinGraphHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinGraphHeaders.cs index 333d85ab2efa..17dde40b4452 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinGraphHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinGraphHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesCreateUpdateGremlinGraphHeaders() /// /// - public GremlinResourcesCreateUpdateGremlinGraphHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesCreateUpdateGremlinGraphHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesCreateUpdateGremlinGraphHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..9ed562597cfe --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders class. + /// + public GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public GremlinResourcesCreateUpdateGremlinRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..5e9f64242069 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders class. + /// + public GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public GremlinResourcesCreateUpdateGremlinRoleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinDatabaseHeaders.cs index 63bf7b6958ed..d45705071890 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinDatabaseHeaders.cs @@ -43,13 +43,13 @@ public GremlinResourcesDeleteGremlinDatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinGraphHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinGraphHeaders.cs index 63e451022477..0eee05ee53b1 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinGraphHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinGraphHeaders.cs @@ -43,13 +43,13 @@ public GremlinResourcesDeleteGremlinGraphHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..d43372e5b839 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleAssignmentHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 GremlinResourcesDeleteGremlinRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the GremlinResourcesDeleteGremlinRoleAssignmentHeaders class. + /// + public GremlinResourcesDeleteGremlinRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinResourcesDeleteGremlinRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + public GremlinResourcesDeleteGremlinRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..4529dcf4380d --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesDeleteGremlinRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 GremlinResourcesDeleteGremlinRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the GremlinResourcesDeleteGremlinRoleDefinitionHeaders class. + /// + public GremlinResourcesDeleteGremlinRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinResourcesDeleteGremlinRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public GremlinResourcesDeleteGremlinRoleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders.cs index bd8de4e2ed31..3043c2bcbc98 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders() /// /// - public GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesMigrateGremlinDatabaseToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders.cs index c2b94a815502..7086599b158a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders() /// /// - public GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesMigrateGremlinDatabaseToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders.cs index c3958ad5def7..04adf3402ca4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders() /// /// - public GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesMigrateGremlinGraphToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders.cs index b09dae5d6a49..ea199b44c341 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders() /// /// - public GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesMigrateGremlinGraphToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesRetrieveContinuousBackupInformationHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesRetrieveContinuousBackupInformationHeaders.cs new file mode 100644 index 000000000000..242b987c63f4 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesRetrieveContinuousBackupInformationHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 GremlinResourcesRetrieveContinuousBackupInformationHeaders + { + /// + /// Initializes a new instance of the GremlinResourcesRetrieveContinuousBackupInformationHeaders class. + /// + public GremlinResourcesRetrieveContinuousBackupInformationHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinResourcesRetrieveContinuousBackupInformationHeaders class. + /// + + /// + /// + + /// + /// + public GremlinResourcesRetrieveContinuousBackupInformationHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinDatabaseThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinDatabaseThroughputHeaders.cs index 3e502cd4b25b..1cd1c26be759 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinDatabaseThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinDatabaseThroughputHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesUpdateGremlinDatabaseThroughputHeaders() /// /// - public GremlinResourcesUpdateGremlinDatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesUpdateGremlinDatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesUpdateGremlinDatabaseThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinGraphThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinGraphThroughputHeaders.cs index 48a7d7272f89..55afe73e50cf 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinGraphThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinResourcesUpdateGremlinGraphThroughputHeaders.cs @@ -26,11 +26,15 @@ public GremlinResourcesUpdateGremlinGraphThroughputHeaders() /// /// - public GremlinResourcesUpdateGremlinGraphThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public GremlinResourcesUpdateGremlinGraphThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public GremlinResourcesUpdateGremlinGraphThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResource.cs new file mode 100644 index 000000000000..79d9bc8cd63b --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResource.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 and update an Azure Cosmos DB Gremlin Role Assignment. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GremlinRoleAssignmentResource : ProxyResource + { + /// + /// Initializes a new instance of the GremlinRoleAssignmentResource class. + /// + public GremlinRoleAssignmentResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinRoleAssignmentResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// Gremlin Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this Gremlin Role Assignment. Tenant + /// ID for the principal is inferred using the tenant associated with the + /// subscription. + /// + + /// Provisioning state of the resource. + /// + public GremlinRoleAssignmentResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + : base(id, name, type, systemData) + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this Gremlin Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this Gremlin Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResourceProperties.cs new file mode 100644 index 000000000000..890cc15af2e3 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleAssignmentResourceProperties.cs @@ -0,0 +1,86 @@ +// 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; + + /// + /// Azure Cosmos DB Gremlin Role Assignment resource object. + /// + public partial class GremlinRoleAssignmentResourceProperties + { + /// + /// Initializes a new instance of the GremlinRoleAssignmentResourceProperties class. + /// + public GremlinRoleAssignmentResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinRoleAssignmentResourceProperties class. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// Gremlin Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this Gremlin Role Assignment. Tenant + /// ID for the principal is inferred using the tenant associated with the + /// subscription. + /// + + /// Provisioning state of the resource. + /// + public GremlinRoleAssignmentResourceProperties(string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this Gremlin Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this Gremlin Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResource.cs new file mode 100644 index 000000000000..78074db5e1a0 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResource.cs @@ -0,0 +1,118 @@ +// 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 and update an Azure Cosmos DB Gremlin Role Definition. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class GremlinRoleDefinitionResource : ProxyResource + { + /// + /// Initializes a new instance of the GremlinRoleDefinitionResource class. + /// + public GremlinRoleDefinitionResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinRoleDefinitionResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which Gremlin Role Assignments + /// may be created using this Role Definition. This will allow application of + /// this Role Definition on the entire database account or any underlying + /// Database / Collection. Must have at least one element. Scopes higher than + /// Database account are not enforceable as assignable Scopes. Note that + /// resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public GremlinRoleDefinitionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string propertiesId = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + : base(id, name, type, systemData) + { + this.PropertiesId = propertiesId; + this.RoleName = roleName; + this.PropertiesType = propertiesType; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.id")] + public string PropertiesId {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public RoleDefinitionType? PropertiesType {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which Gremlin Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResourceProperties.cs new file mode 100644 index 000000000000..8761e7e2331d --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/GremlinRoleDefinitionResourceProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + /// + /// Azure Cosmos DB Gremlin Role Definition resource object. + /// + public partial class GremlinRoleDefinitionResourceProperties + { + /// + /// Initializes a new instance of the GremlinRoleDefinitionResourceProperties class. + /// + public GremlinRoleDefinitionResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinRoleDefinitionResourceProperties class. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which Gremlin Role Assignments + /// may be created using this Role Definition. This will allow application of + /// this Role Definition on the entire database account or any underlying + /// Database / Collection. Must have at least one element. Scopes higher than + /// Database account are not enforceable as assignable Scopes. Note that + /// resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public GremlinRoleDefinitionResourceProperties(string id = default(string), string roleName = default(string), RoleDefinitionType? type = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + { + this.Id = id; + this.RoleName = roleName; + this.Type = type; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public RoleDefinitionType? Type {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which Gremlin Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Location.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Location.cs index 3d80ba1288a0..2690081660e5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Location.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Location.cs @@ -35,14 +35,7 @@ public Location() /// https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/ /// - /// The status of the Cosmos DB account at the time the operation was called. - /// The status can be one of following. 'Creating' – the Cosmos DB account is - /// being created. When an account is in Creating state, only properties that - /// are specified as input for the Create Cosmos DB account operation are - /// returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' - /// – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - /// account is being deleted. 'Failed' – the Cosmos DB account failed creation. - /// 'DeletionFailed' – the Cosmos DB account deletion failed. + /// The provisioning state of the resource. /// /// The failover priority of the region. A failover priority of 0 indicates a @@ -92,14 +85,7 @@ public Location() public string DocumentEndpoint {get; private set; } /// - /// Gets the status of the Cosmos DB account at the time the operation was - /// called. The status can be one of following. 'Creating' – the Cosmos DB - /// account is being created. When an account is in Creating state, only - /// properties that are specified as input for the Create Cosmos DB account - /// operation are returned. 'Succeeded' – the Cosmos DB account is active for - /// use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the - /// Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed - /// creation. 'DeletionFailed' – the Cosmos DB account deletion failed. + /// Gets the provisioning state of the resource. /// [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState {get; private set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationGetResult.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationGetResult.cs index 7b47cd07a314..71e23f19105f 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationGetResult.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationGetResult.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// Cosmos DB location get result /// - public partial class LocationGetResult : ARMProxyResource + public partial class LocationGetResult : ProxyResource { /// /// Initializes a new instance of the LocationGetResult class. @@ -24,20 +24,26 @@ public LocationGetResult() /// Initializes a new instance of the LocationGetResult class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Cosmos DB location metadata /// - public LocationGetResult(string id = default(string), string name = default(string), string type = default(string), LocationProperties properties = default(LocationProperties)) + public LocationGetResult(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), LocationProperties properties = default(LocationProperties)) - : base(id, name, type) + : base(id, name, type, systemData) { this.Properties = properties; CustomInit(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationProperties.cs index d6441aca8608..18b0e8e4fe3d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/LocationProperties.cs @@ -43,8 +43,8 @@ public LocationProperties() /// Enum to indicate current buildout status of the region. /// Possible values include: 'Uninitialized', 'Initializing', - /// 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', - /// 'Canceled', 'Updating' + /// 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', + /// 'Updating', 'Creating' public LocationProperties(bool? supportsAvailabilityZone = default(bool?), bool? isResidencyRestricted = default(bool?), System.Collections.Generic.IList backupStorageRedundancies = default(System.Collections.Generic.IList), bool? isSubscriptionRegionAccessAllowedForRegular = default(bool?), bool? isSubscriptionRegionAccessAllowedForAz = default(bool?), string status = default(string)) { @@ -97,7 +97,7 @@ public LocationProperties() public bool? IsSubscriptionRegionAccessAllowedForAz {get; private set; } /// - /// Gets enum to indicate current buildout status of the region. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Updating' + /// Gets enum to indicate current buildout status of the region. Possible values include: 'Uninitialized', 'Initializing', 'InternallyReady', 'Online', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Updating', 'Creating' /// [Newtonsoft.Json.JsonProperty(PropertyName = "status")] public string Status {get; private set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedCassandraARMResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedCassandraARMResourceProperties.cs deleted file mode 100644 index a6c4cba4448d..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedCassandraARMResourceProperties.cs +++ /dev/null @@ -1,112 +0,0 @@ -// 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; - - /// - /// The core properties of ARM resources. - /// - public partial class ManagedCassandraARMResourceProperties : Microsoft.Rest.Azure.IResource - { - /// - /// Initializes a new instance of the ManagedCassandraARMResourceProperties class. - /// - public ManagedCassandraARMResourceProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ManagedCassandraARMResourceProperties class. - /// - - /// The unique resource identifier of the ARM resource. - /// - - /// The name of the ARM resource. - /// - - /// The type of Azure resource. - /// - - /// The location of the resource group to which the resource belongs. - /// - - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". - /// - - /// Identity for the resource. - /// - public ManagedCassandraARMResourceProperties(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedCassandraManagedServiceIdentity identity = default(ManagedCassandraManagedServiceIdentity)) - - { - this.Id = id; - this.Name = name; - this.Type = type; - this.Location = location; - this.Tags = tags; - this.Identity = identity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets the unique resource identifier of the ARM resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; private set; } - - /// - /// Gets the name of the ARM resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; private set; } - - /// - /// Gets the type of Azure resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type {get; private set; } - - /// - /// Gets or sets the location of the resource group to which the resource - /// belongs. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location {get; set; } - - /// - /// Gets or sets tags are a list of key-value pairs that describe the resource. - /// These tags can be used in viewing and grouping this resource (across - /// resource groups). A maximum of 15 tags can be provided for a resource. Each - /// tag must have a key no greater than 128 characters and value no greater - /// than 256 characters. For example, the default experience for a template - /// type is set with "defaultExperience": "Cassandra". Current - /// "defaultExperience" values also include "Table", "Graph", "DocumentDB", and - /// "MongoDB". - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags {get; set; } - - /// - /// Gets or sets identity for the resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] - public ManagedCassandraManagedServiceIdentity Identity {get; set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs index e3e58d8cdf89..0a80ce47480e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentity.cs @@ -43,7 +43,7 @@ public ManagedServiceIdentity() /// dictionary key references will be ARM resource ids in the form: /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// - public ManagedServiceIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) + public ManagedServiceIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?), System.Collections.Generic.IDictionary userAssignedIdentities = default(System.Collections.Generic.IDictionary)) { this.PrincipalId = principalId; @@ -88,6 +88,6 @@ public ManagedServiceIdentity() /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedIdentities")] - public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } + public System.Collections.Generic.IDictionary UserAssignedIdentities {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentities.cs similarity index 67% rename from src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs rename to src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentities.cs index a5031cdb6139..e1004d6ef144 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ManagedServiceIdentityUserAssignedIdentities.cs @@ -7,18 +7,18 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties + public partial class ManagedServiceIdentityUserAssignedIdentities { /// - /// Initializes a new instance of the Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties class. + /// Initializes a new instance of the ManagedServiceIdentityUserAssignedIdentities class. /// - public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties() + public ManagedServiceIdentityUserAssignedIdentities() { CustomInit(); } /// - /// Initializes a new instance of the Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties class. + /// Initializes a new instance of the ManagedServiceIdentityUserAssignedIdentities class. /// /// The principal id of user assigned identity. @@ -26,7 +26,7 @@ public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedident /// The client id of user assigned identity. /// - public Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(string principalId = default(string), string clientId = default(string)) + public ManagedServiceIdentityUserAssignedIdentities(string principalId = default(string), string clientId = default(string)) { this.PrincipalId = principalId; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MaterializedViewsBuilderServiceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MaterializedViewsBuilderServiceResource.cs deleted file mode 100644 index f1cb37ec3f75..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MaterializedViewsBuilderServiceResource.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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; - - /// - /// Describes the service response property for MaterializedViewsBuilder. - /// - public partial class MaterializedViewsBuilderServiceResource - { - /// - /// Initializes a new instance of the MaterializedViewsBuilderServiceResource class. - /// - public MaterializedViewsBuilderServiceResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MaterializedViewsBuilderServiceResource class. - /// - - /// Properties for MaterializedViewsBuilderServiceResource. - /// - public MaterializedViewsBuilderServiceResource(MaterializedViewsBuilderServiceResourceProperties properties = default(MaterializedViewsBuilderServiceResourceProperties)) - - { - this.Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets properties for MaterializedViewsBuilderServiceResource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public MaterializedViewsBuilderServiceResourceProperties Properties {get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.Properties != null) - { - this.Properties.Validate(); - } - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs index 12fe809e2cd1..8b21e5e41cc2 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public MongoDBCollectionCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a MongoDB collection /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public MongoDBCollectionCreateUpdateParameters(MongoDBCollectionResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public MongoDBCollectionCreateUpdateParameters(MongoDBCollectionResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetPropertiesResource.cs index 8bbc19c373c2..79e646ccc59c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class MongoDBCollectionGetPropertiesResource + public partial class MongoDBCollectionGetPropertiesResource : MongoDBCollectionResource { /// /// Initializes a new instance of the MongoDBCollectionGetPropertiesResource class. @@ -51,13 +51,8 @@ public MongoDBCollectionGetPropertiesResource() /// public MongoDBCollectionGetPropertiesResource(string id, System.Collections.Generic.IDictionary shardKey = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList indexes = default(System.Collections.Generic.IList), int? analyticalStorageTtl = default(int?), ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, shardKey, indexes, analyticalStorageTtl, restoreParameters, createMode) { - this.Id = id; - this.ShardKey = shardKey; - this.Indexes = indexes; - this.AnalyticalStorageTtl = analyticalStorageTtl; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -70,42 +65,6 @@ public MongoDBCollectionGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB MongoDB collection - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets a key-value pair of shard keys to be applied for the request. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "shardKey")] - public System.Collections.Generic.IDictionary ShardKey {get; set; } - - /// - /// Gets or sets list of index keys - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "indexes")] - public System.Collections.Generic.IList Indexes {get; set; } - - /// - /// Gets or sets analytical TTL. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "analyticalStorageTtl")] - public int? AnalyticalStorageTtl {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -131,17 +90,9 @@ public MongoDBCollectionGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetResults.cs index 74c252a28447..231859bafd40 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBCollectionGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB MongoDB collection. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class MongoDBCollectionGetResults : ARMResourceProperties + public partial class MongoDBCollectionGetResults : Resource { /// /// Initializes a new instance of the MongoDBCollectionGetResults class. @@ -25,25 +25,28 @@ public MongoDBCollectionGetResults() /// Initializes a new instance of the MongoDBCollectionGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public MongoDBCollectionGetResults() /// /// - public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource), MongoDBCollectionGetPropertiesOptions options = default(MongoDBCollectionGetPropertiesOptions)) + public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource), MongoDBCollectionGetPropertiesOptions options = default(MongoDBCollectionGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public MongoDBCollectionGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public MongoDBCollectionGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs index 51561ba88ea8..df359075769d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public MongoDBDatabaseCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a MongoDB database /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public MongoDBDatabaseCreateUpdateParameters(MongoDBDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public MongoDBDatabaseCreateUpdateParameters(MongoDBDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs index 8dd0438ff189..9d2ce0ded444 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class MongoDBDatabaseGetPropertiesResource + public partial class MongoDBDatabaseGetPropertiesResource : MongoDBDatabaseResource { /// /// Initializes a new instance of the MongoDBDatabaseGetPropertiesResource class. @@ -27,7 +27,7 @@ public MongoDBDatabaseGetPropertiesResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// A system generated property. A unique identifier. @@ -42,10 +42,8 @@ public MongoDBDatabaseGetPropertiesResource() /// public MongoDBDatabaseGetPropertiesResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, restoreParameters, createMode) { - this.Id = id; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -58,24 +56,6 @@ public MongoDBDatabaseGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB MongoDB database - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -101,15 +81,9 @@ public MongoDBDatabaseGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetResults.cs index 13c588c92789..b5c63e281058 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB MongoDB database. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class MongoDBDatabaseGetResults : ARMResourceProperties + public partial class MongoDBDatabaseGetResults : Resource { /// /// Initializes a new instance of the MongoDBDatabaseGetResults class. @@ -25,25 +25,28 @@ public MongoDBDatabaseGetResults() /// Initializes a new instance of the MongoDBDatabaseGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public MongoDBDatabaseGetResults() /// /// - public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource), MongoDBDatabaseGetPropertiesOptions options = default(MongoDBDatabaseGetPropertiesOptions)) + public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource), MongoDBDatabaseGetPropertiesOptions options = default(MongoDBDatabaseGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public MongoDBDatabaseGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public MongoDBDatabaseGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseResource.cs index 75769dc10f2f..c16b34441483 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBDatabaseResource.cs @@ -30,7 +30,7 @@ public MongoDBDatabaseResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' public MongoDBDatabaseResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string)) @@ -60,7 +60,7 @@ public MongoDBDatabaseResource() public ResourceRestoreParameters RestoreParameters {get; set; } /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' + /// Gets or sets enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' /// [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] public string CreateMode {get; set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBCollectionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBCollectionHeaders.cs index b15431e66554..06274a694ac7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBCollectionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBCollectionHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesCreateUpdateMongoDbcollectionHeaders() /// /// - public MongoDbResourcesCreateUpdateMongoDbcollectionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesCreateUpdateMongoDbcollectionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesCreateUpdateMongoDbcollectionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders.cs index 66db25ec547b..45031229f9a3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesCreateUpdateMongoDBDatabaseHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesCreateUpdateMongoDbdatabaseHeaders() /// /// - public MongoDbResourcesCreateUpdateMongoDbdatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesCreateUpdateMongoDbdatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesCreateUpdateMongoDbdatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBCollectionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBCollectionHeaders.cs index b5822049e2ef..0d25270a8be3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBCollectionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBCollectionHeaders.cs @@ -43,13 +43,13 @@ public MongoDbResourcesDeleteMongoDbcollectionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBDatabaseHeaders.cs index 0ac60a0a0b40..6552542430a6 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesDeleteMongoDBDatabaseHeaders.cs @@ -43,13 +43,13 @@ public MongoDbResourcesDeleteMongoDbdatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders.cs index c5568aa8bc86..7dd7883928ce 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesMigrateMongoDbcollectionToAutoscaleHeaders() /// /// - public MongoDbResourcesMigrateMongoDbcollectionToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesMigrateMongoDbcollectionToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesMigrateMongoDbcollectionToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders.cs index 7b62e5068639..68bf401604f5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBCollectionToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesMigrateMongoDbcollectionToManualThroughputHeaders() /// /// - public MongoDbResourcesMigrateMongoDbcollectionToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesMigrateMongoDbcollectionToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesMigrateMongoDbcollectionToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders.cs index 5eb9628321e1..de998da9192a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesMigrateMongoDbdatabaseToAutoscaleHeaders() /// /// - public MongoDbResourcesMigrateMongoDbdatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesMigrateMongoDbdatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesMigrateMongoDbdatabaseToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders.cs index d240cae4271c..67ab403917ec 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesMigrateMongoDbdatabaseToManualThroughputHeaders() /// /// - public MongoDbResourcesMigrateMongoDbdatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesMigrateMongoDbdatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesMigrateMongoDbdatabaseToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders.cs index f11ca347bdef..44c07d60ea79 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBCollectionThroughputHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesUpdateMongoDbcollectionThroughputHeaders() /// /// - public MongoDbResourcesUpdateMongoDbcollectionThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesUpdateMongoDbcollectionThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesUpdateMongoDbcollectionThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders.cs index e2a7fe5c3a03..fbfd026ea8da 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDBResourcesUpdateMongoDBDatabaseThroughputHeaders.cs @@ -26,11 +26,15 @@ public MongoDbResourcesUpdateMongoDbdatabaseThroughputHeaders() /// /// - public MongoDbResourcesUpdateMongoDbdatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public MongoDbResourcesUpdateMongoDbdatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public MongoDbResourcesUpdateMongoDbdatabaseThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..078da61dcbac --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders class. + /// + public MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public MongoDbResourcesCreateUpdateMongoRoleDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders.cs new file mode 100644 index 000000000000..ea1c28fdae9b --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders class. + /// + public MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public MongoDbResourcesCreateUpdateMongoUserDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..b0e61fc1871d --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoDbResourcesDeleteMongoRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoDbResourcesDeleteMongoRoleDefinitionHeaders class. + /// + public MongoDbResourcesDeleteMongoRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoDbResourcesDeleteMongoRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public MongoDbResourcesDeleteMongoRoleDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoUserDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoUserDefinitionHeaders.cs new file mode 100644 index 000000000000..e3376b42f665 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesDeleteMongoUserDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoDbResourcesDeleteMongoUserDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoDbResourcesDeleteMongoUserDefinitionHeaders class. + /// + public MongoDbResourcesDeleteMongoUserDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoDbResourcesDeleteMongoUserDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public MongoDbResourcesDeleteMongoUserDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesRetrieveContinuousBackupInformationHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesRetrieveContinuousBackupInformationHeaders.cs new file mode 100644 index 000000000000..b2c9d73e4662 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoDbResourcesRetrieveContinuousBackupInformationHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoDbResourcesRetrieveContinuousBackupInformationHeaders + { + /// + /// Initializes a new instance of the MongoDbResourcesRetrieveContinuousBackupInformationHeaders class. + /// + public MongoDbResourcesRetrieveContinuousBackupInformationHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoDbResourcesRetrieveContinuousBackupInformationHeaders class. + /// + + /// + /// + + /// + /// + public MongoDbResourcesRetrieveContinuousBackupInformationHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResource.cs new file mode 100644 index 000000000000..632a6f18f71a --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResource.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 and update an Azure Cosmos DB MongoMI Role Assignment. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class MongoMIRoleAssignmentResource : ProxyResource + { + /// + /// Initializes a new instance of the MongoMIRoleAssignmentResource class. + /// + public MongoMIRoleAssignmentResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMIRoleAssignmentResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// MongoMI Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this MongoMI Role Assignment. Tenant + /// ID for the principal is inferred using the tenant associated with the + /// subscription. + /// + + /// Provisioning state of the resource. + /// + public MongoMIRoleAssignmentResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + : base(id, name, type, systemData) + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this MongoMI Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this MongoMI Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResourceProperties.cs new file mode 100644 index 000000000000..22a56acadc26 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleAssignmentResourceProperties.cs @@ -0,0 +1,86 @@ +// 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; + + /// + /// Azure Cosmos DB MongoMI Role Assignment resource object. + /// + public partial class MongoMIRoleAssignmentResourceProperties + { + /// + /// Initializes a new instance of the MongoMIRoleAssignmentResourceProperties class. + /// + public MongoMIRoleAssignmentResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMIRoleAssignmentResourceProperties class. + /// + + /// The unique identifier for the associated Role Definition. + /// + + /// The data plane resource path for which access is being granted through this + /// MongoMI Role Assignment. + /// + + /// The unique identifier for the associated AAD principal in the AAD graph to + /// which access is being granted through this MongoMI Role Assignment. Tenant + /// ID for the principal is inferred using the tenant associated with the + /// subscription. + /// + + /// Provisioning state of the resource. + /// + public MongoMIRoleAssignmentResourceProperties(string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string), string provisioningState = default(string)) + + { + this.RoleDefinitionId = roleDefinitionId; + this.Scope = scope; + this.PrincipalId = principalId; + this.ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the unique identifier for the associated Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleDefinitionId")] + public string RoleDefinitionId {get; set; } + + /// + /// Gets or sets the data plane resource path for which access is being granted + /// through this MongoMI Role Assignment. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "scope")] + public string Scope {get; set; } + + /// + /// Gets or sets the unique identifier for the associated AAD principal in the + /// AAD graph to which access is being granted through this MongoMI Role + /// Assignment. Tenant ID for the principal is inferred using the tenant + /// associated with the subscription. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "principalId")] + public string PrincipalId {get; set; } + + /// + /// Gets provisioning state of the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState {get; private set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResource.cs new file mode 100644 index 000000000000..214692ee8d38 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResource.cs @@ -0,0 +1,118 @@ +// 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 and update an Azure Cosmos DB MongoMI Role Definition. + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class MongoMIRoleDefinitionResource : ProxyResource + { + /// + /// Initializes a new instance of the MongoMIRoleDefinitionResource class. + /// + public MongoMIRoleDefinitionResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMIRoleDefinitionResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which MongoMI Role Assignments + /// may be created using this Role Definition. This will allow application of + /// this Role Definition on the entire database account or any underlying + /// Database / Collection. Must have at least one element. Scopes higher than + /// Database account are not enforceable as assignable Scopes. Note that + /// resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public MongoMIRoleDefinitionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string propertiesId = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + : base(id, name, type, systemData) + { + this.PropertiesId = propertiesId; + this.RoleName = roleName; + this.PropertiesType = propertiesType; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.id")] + public string PropertiesId {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.type")] + public RoleDefinitionType? PropertiesType {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which MongoMI Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResourceProperties.cs new file mode 100644 index 000000000000..f794f5ae618e --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMIRoleDefinitionResourceProperties.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + /// + /// Azure Cosmos DB MongoMI Role Definition resource object. + /// + public partial class MongoMIRoleDefinitionResourceProperties + { + /// + /// Initializes a new instance of the MongoMIRoleDefinitionResourceProperties class. + /// + public MongoMIRoleDefinitionResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMIRoleDefinitionResourceProperties class. + /// + + /// The path id for the Role Definition. + /// + + /// A user-friendly name for the Role Definition. Must be unique for the + /// database account. + /// + + /// Indicates whether the Role Definition was built-in or user created. + /// Possible values include: 'BuiltInRole', 'CustomRole' + + /// A set of fully qualified Scopes at or below which MongoMI Role Assignments + /// may be created using this Role Definition. This will allow application of + /// this Role Definition on the entire database account or any underlying + /// Database / Collection. Must have at least one element. Scopes higher than + /// Database account are not enforceable as assignable Scopes. Note that + /// resources referenced in assignable Scopes need not exist. + /// + + /// The set of operations allowed through this Role Definition. + /// + public MongoMIRoleDefinitionResourceProperties(string id = default(string), string roleName = default(string), RoleDefinitionType? type = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + + { + this.Id = id; + this.RoleName = roleName; + this.Type = type; + this.AssignableScopes = assignableScopes; + this.Permissions = permissions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the path id for the Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + + /// + /// Gets or sets a user-friendly name for the Role Definition. Must be unique + /// for the database account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "roleName")] + public string RoleName {get; set; } + + /// + /// Gets or sets indicates whether the Role Definition was built-in or user + /// created. Possible values include: 'BuiltInRole', 'CustomRole' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public RoleDefinitionType? Type {get; set; } + + /// + /// Gets or sets a set of fully qualified Scopes at or below which MongoMI Role + /// Assignments may be created using this Role Definition. This will allow + /// application of this Role Definition on the entire database account or any + /// underlying Database / Collection. Must have at least one element. Scopes + /// higher than Database account are not enforceable as assignable Scopes. Note + /// that resources referenced in assignable Scopes need not exist. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "assignableScopes")] + public System.Collections.Generic.IList AssignableScopes {get; set; } + + /// + /// Gets or sets the set of operations allowed through this Role Definition. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] + public System.Collections.Generic.IList Permissions {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders.cs new file mode 100644 index 000000000000..794b355ff5c0 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders + { + /// + /// Initializes a new instance of the MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders class. + /// + public MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public MongoMiResourcesCreateUpdateMongoMiroleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders.cs new file mode 100644 index 000000000000..ec8071ccfcad --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders class. + /// + public MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public MongoMiResourcesCreateUpdateMongoMiroleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleAssignmentHeaders.cs new file mode 100644 index 000000000000..71ab638b73e5 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleAssignmentHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoMiResourcesDeleteMongoMiroleAssignmentHeaders + { + /// + /// Initializes a new instance of the MongoMiResourcesDeleteMongoMiroleAssignmentHeaders class. + /// + public MongoMiResourcesDeleteMongoMiroleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMiResourcesDeleteMongoMiroleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + public MongoMiResourcesDeleteMongoMiroleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleDefinitionHeaders.cs new file mode 100644 index 000000000000..1ad8476a3dd2 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoMiResourcesDeleteMongoMiroleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 MongoMiResourcesDeleteMongoMiroleDefinitionHeaders + { + /// + /// Initializes a new instance of the MongoMiResourcesDeleteMongoMiroleDefinitionHeaders class. + /// + public MongoMiResourcesDeleteMongoMiroleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MongoMiResourcesDeleteMongoMiroleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public MongoMiResourcesDeleteMongoMiroleDefinitionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoRoleDefinitionGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoRoleDefinitionGetResults.cs index a7d40d53f81f..396f95dba425 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoRoleDefinitionGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoRoleDefinitionGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Mongo Role Definition. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class MongoRoleDefinitionGetResults : ARMProxyResource + public partial class MongoRoleDefinitionGetResults : ProxyResource { /// /// Initializes a new instance of the MongoRoleDefinitionGetResults class. @@ -25,13 +25,19 @@ public MongoRoleDefinitionGetResults() /// Initializes a new instance of the MongoRoleDefinitionGetResults class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// A user-friendly name for the Role Definition. Must be unique for the @@ -53,9 +59,9 @@ public MongoRoleDefinitionGetResults() /// The set of roles inherited by this Role Definition. /// - public MongoRoleDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), string roleName = default(string), MongoRoleDefinitionType? propertiesType = default(MongoRoleDefinitionType?), string databaseName = default(string), System.Collections.Generic.IList privileges = default(System.Collections.Generic.IList), System.Collections.Generic.IList roles = default(System.Collections.Generic.IList)) + public MongoRoleDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleName = default(string), MongoRoleDefinitionType? propertiesType = default(MongoRoleDefinitionType?), string databaseName = default(string), System.Collections.Generic.IList privileges = default(System.Collections.Generic.IList), System.Collections.Generic.IList roles = default(System.Collections.Generic.IList)) - : base(id, name, type) + : base(id, name, type, systemData) { this.RoleName = roleName; this.PropertiesType = propertiesType; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoUserDefinitionGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoUserDefinitionGetResults.cs index c3dcc963af28..b7d3d76a3f61 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoUserDefinitionGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/MongoUserDefinitionGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB User Definition /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class MongoUserDefinitionGetResults : ARMProxyResource + public partial class MongoUserDefinitionGetResults : ProxyResource { /// /// Initializes a new instance of the MongoUserDefinitionGetResults class. @@ -25,13 +25,19 @@ public MongoUserDefinitionGetResults() /// Initializes a new instance of the MongoUserDefinitionGetResults class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// The user name for User Definition. @@ -53,9 +59,9 @@ public MongoUserDefinitionGetResults() /// The Mongo Auth mechanism. For now, we only support auth mechanism /// SCRAM-SHA-256. /// - public MongoUserDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), string userName = default(string), string password = default(string), string databaseName = default(string), string customData = default(string), System.Collections.Generic.IList roles = default(System.Collections.Generic.IList), string mechanisms = default(string)) + public MongoUserDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string userName = default(string), string password = default(string), string databaseName = default(string), string customData = default(string), System.Collections.Generic.IList roles = default(System.Collections.Generic.IList), string mechanisms = default(string)) - : base(id, name, type) + : base(id, name, type, systemData) { this.UserName = userName; this.Password = password; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspace.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspace.cs index 4751bd9b3714..16d22de52b7d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspace.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspace.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// A notebook workspace resource /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class NotebookWorkspace : ARMProxyResource + public partial class NotebookWorkspace : ProxyResource { /// /// Initializes a new instance of the NotebookWorkspace class. @@ -25,13 +25,19 @@ public NotebookWorkspace() /// Initializes a new instance of the NotebookWorkspace class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Specifies the endpoint of Notebook server. @@ -40,9 +46,9 @@ public NotebookWorkspace() /// 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)) + public NotebookWorkspace(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string notebookServerEndpoint = default(string), string status = default(string)) - : base(id, name, type) + : base(id, name, type, systemData) { this.NotebookServerEndpoint = notebookServerEndpoint; this.Status = status; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesCreateOrUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..2cefb4546f3f --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesCreateOrUpdateHeaders.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 NotebookWorkspacesCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the NotebookWorkspacesCreateOrUpdateHeaders class. + /// + public NotebookWorkspacesCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspacesCreateOrUpdateHeaders class. + /// + + /// + /// + public NotebookWorkspacesCreateOrUpdateHeaders(string location = default(string)) + + { + this.Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesDeleteHeaders.cs new file mode 100644 index 000000000000..2dcceca99221 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 NotebookWorkspacesDeleteHeaders + { + /// + /// Initializes a new instance of the NotebookWorkspacesDeleteHeaders class. + /// + public NotebookWorkspacesDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspacesDeleteHeaders class. + /// + + /// + /// + + /// + /// + public NotebookWorkspacesDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesRegenerateAuthTokenHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesRegenerateAuthTokenHeaders.cs new file mode 100644 index 000000000000..7b934accbd71 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesRegenerateAuthTokenHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 NotebookWorkspacesRegenerateAuthTokenHeaders + { + /// + /// Initializes a new instance of the NotebookWorkspacesRegenerateAuthTokenHeaders class. + /// + public NotebookWorkspacesRegenerateAuthTokenHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspacesRegenerateAuthTokenHeaders class. + /// + + /// + /// + + /// + /// + public NotebookWorkspacesRegenerateAuthTokenHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesStartHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesStartHeaders.cs new file mode 100644 index 000000000000..e666ffa735f4 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/NotebookWorkspacesStartHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 NotebookWorkspacesStartHeaders + { + /// + /// Initializes a new instance of the NotebookWorkspacesStartHeaders class. + /// + public NotebookWorkspacesStartHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspacesStartHeaders class. + /// + + /// + /// + + /// + /// + public NotebookWorkspacesStartHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page.cs index 53a6c793e8c3..492824c211ab 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page.cs @@ -16,7 +16,7 @@ public class Page : Microsoft.Rest.Azure.IPage /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("")] + [Newtonsoft.Json.JsonProperty("nextLink")] public System.String NextPageLink { get; private set; } [Newtonsoft.Json.JsonProperty("value")] diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page1.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page1.cs deleted file mode 100644 index c5545c7fb409..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Page1.cs +++ /dev/null @@ -1,43 +0,0 @@ -// 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 -{ - - /// - /// Defines a page in Azure responses. - /// - /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page1 : Microsoft.Rest.Azure.IPage - { - /// - /// Gets the link to the next page. - /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } - - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() - { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Permission.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Permission.cs index 258d7c4c8cf8..0e5aa875f471 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Permission.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Permission.cs @@ -24,14 +24,18 @@ public Permission() /// Initializes a new instance of the Permission class. /// + /// The id for the permission. + /// + /// An array of data actions that are allowed. /// /// An array of data actions that are denied. /// - public Permission(System.Collections.Generic.IList dataActions = default(System.Collections.Generic.IList), System.Collections.Generic.IList notDataActions = default(System.Collections.Generic.IList)) + public Permission(string id = default(string), System.Collections.Generic.IList dataActions = default(System.Collections.Generic.IList), System.Collections.Generic.IList notDataActions = default(System.Collections.Generic.IList)) { + this.Id = id; this.DataActions = dataActions; this.NotDataActions = notDataActions; CustomInit(); @@ -43,6 +47,12 @@ public Permission() partial void CustomInit(); + /// + /// Gets or sets the id for the permission. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; set; } + /// /// Gets or sets an array of data actions that are allowed. /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PermissionAutoGenerated.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PermissionAutoGenerated.cs deleted file mode 100644 index 662f06a32488..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PermissionAutoGenerated.cs +++ /dev/null @@ -1,68 +0,0 @@ -// 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; - - /// - /// The set of data plane operations permitted through this Role Definition. - /// - public partial class PermissionAutoGenerated - { - /// - /// Initializes a new instance of the PermissionAutoGenerated class. - /// - public PermissionAutoGenerated() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PermissionAutoGenerated class. - /// - - /// The id for the permission. - /// - - /// An array of data actions that are allowed. - /// - - /// An array of data actions that are denied. - /// - public PermissionAutoGenerated(string id = default(string), System.Collections.Generic.IList dataActions = default(System.Collections.Generic.IList), System.Collections.Generic.IList notDataActions = default(System.Collections.Generic.IList)) - - { - this.Id = id; - this.DataActions = dataActions; - this.NotDataActions = notDataActions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets the id for the permission. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets an array of data actions that are allowed. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "dataActions")] - public System.Collections.Generic.IList DataActions {get; set; } - - /// - /// Gets or sets an array of data actions that are denied. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "notDataActions")] - public System.Collections.Generic.IList NotDataActions {get; set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs index 4cf1f15198ab..95c375c4219a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnection.cs @@ -25,8 +25,8 @@ public PrivateEndpointConnection() /// Initializes a new instance of the PrivateEndpointConnection class. /// - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// /// The name of the resource @@ -36,6 +36,10 @@ public PrivateEndpointConnection() /// "Microsoft.Storage/storageAccounts" /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + /// Private endpoint which the connection belongs to. /// @@ -47,9 +51,9 @@ public PrivateEndpointConnection() /// 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)) + public PrivateEndpointConnection(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), PrivateEndpointProperty privateEndpoint = default(PrivateEndpointProperty), PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState = default(PrivateLinkServiceConnectionStateProperty), string groupId = default(string), string provisioningState = default(string)) - : base(id, name, type) + : base(id, name, type, systemData) { this.PrivateEndpoint = privateEndpoint; this.PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsCreateOrUpdateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..d526032b46e4 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsCreateOrUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 PrivateEndpointConnectionsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsCreateOrUpdateHeaders class. + /// + public PrivateEndpointConnectionsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionsCreateOrUpdateHeaders class. + /// + + /// + /// + + /// + /// + public PrivateEndpointConnectionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsDeleteHeaders.cs new file mode 100644 index 000000000000..0a1161abfd85 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateEndpointConnectionsDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 PrivateEndpointConnectionsDeleteHeaders + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionsDeleteHeaders class. + /// + public PrivateEndpointConnectionsDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionsDeleteHeaders class. + /// + + /// + /// + + /// + /// + public PrivateEndpointConnectionsDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateLinkResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateLinkResource.cs index 9d920420a6d7..2f7f8964e8be 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateLinkResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/PrivateLinkResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// A private link resource /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class PrivateLinkResource : ARMProxyResource + public partial class PrivateLinkResource : ProxyResource { /// /// Initializes a new instance of the PrivateLinkResource class. @@ -25,13 +25,19 @@ public PrivateLinkResource() /// Initializes a new instance of the PrivateLinkResource class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// The private link resource group id. @@ -42,9 +48,9 @@ public PrivateLinkResource() /// 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), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) + public PrivateLinkResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string groupId = default(string), System.Collections.Generic.IList requiredMembers = default(System.Collections.Generic.IList), System.Collections.Generic.IList requiredZoneNames = default(System.Collections.Generic.IList)) - : base(id, name, type) + : base(id, name, type, systemData) { this.GroupId = groupId; this.RequiredMembers = requiredMembers; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResource.cs index 32843e8c6df2..efe6008f259a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResource.cs @@ -29,8 +29,8 @@ public ProxyResource() /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// /// The name of the resource @@ -39,9 +39,13 @@ public ProxyResource() /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" /// - public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + + : base(id, name, type, systemData) { CustomInit(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated.cs deleted file mode 100644 index c0271c2e378d..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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; - - /// - /// The resource model definition for a Azure Resource Manager proxy resource. - /// It will not have tags and a location - /// - /// - /// The resource model definition for a Azure Resource Manager proxy resource. - /// It will not have tags and a location - /// - public partial class ProxyResourceAutoGenerated : ResourceAutoGenerated - { - /// - /// Initializes a new instance of the ProxyResourceAutoGenerated class. - /// - public ProxyResourceAutoGenerated() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProxyResourceAutoGenerated class. - /// - - /// Fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - - /// The name of the resource - /// - - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - - /// Azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - public ProxyResourceAutoGenerated(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - - : base(id, name, type, systemData) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated2.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated2.cs deleted file mode 100644 index 2ce0a1fc94b6..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated2.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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; - - /// - /// The resource model definition for a Azure Resource Manager proxy resource. - /// It will not have tags and a location - /// - /// - /// The resource model definition for a Azure Resource Manager proxy resource. - /// It will not have tags and a location - /// - public partial class ProxyResourceAutoGenerated2 : ResourceAutoGenerated2 - { - /// - /// Initializes a new instance of the ProxyResourceAutoGenerated2 class. - /// - public ProxyResourceAutoGenerated2() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProxyResourceAutoGenerated2 class. - /// - - /// Fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - - /// The name of the resource - /// - - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - - /// Azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - public ProxyResourceAutoGenerated2(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - - : base(id, name, type, systemData) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Resource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Resource.cs index b6944a99331e..a4d4a07f0ad3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Resource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Resource.cs @@ -29,8 +29,8 @@ public Resource() /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// /// The name of the resource @@ -39,12 +39,17 @@ public Resource() /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" /// - public Resource(string id = default(string), string name = default(string), string type = default(string)) + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { this.Id = id; this.Name = name; this.Type = type; + this.SystemData = systemData; CustomInit(); } @@ -55,8 +60,8 @@ public Resource() /// - /// Gets fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// Gets fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id {get; private set; } @@ -73,5 +78,12 @@ public Resource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type {get; private set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated.cs deleted file mode 100644 index 0c83eedd966e..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated.cs +++ /dev/null @@ -1,89 +0,0 @@ -// 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; - - /// - /// Common fields that are returned in the response for all Azure Resource - /// Manager resources - /// - /// - /// Common fields that are returned in the response for all Azure Resource - /// Manager resources - /// - public partial class ResourceAutoGenerated : Microsoft.Rest.Azure.IResource - { - /// - /// Initializes a new instance of the ResourceAutoGenerated class. - /// - public ResourceAutoGenerated() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceAutoGenerated class. - /// - - /// Fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - - /// The name of the resource - /// - - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - - /// Azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - public ResourceAutoGenerated(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - - { - this.Id = id; - this.Name = name; - this.Type = type; - this.SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; private set; } - - /// - /// Gets the name of the resource - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; private set; } - - /// - /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type {get; private set; } - - /// - /// Gets azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] - public SystemData SystemData {get; private set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated2.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated2.cs deleted file mode 100644 index 842609bd7ddc..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ResourceAutoGenerated2.cs +++ /dev/null @@ -1,89 +0,0 @@ -// 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; - - /// - /// Common fields that are returned in the response for all Azure Resource - /// Manager resources - /// - /// - /// Common fields that are returned in the response for all Azure Resource - /// Manager resources - /// - public partial class ResourceAutoGenerated2 : Microsoft.Rest.Azure.IResource - { - /// - /// Initializes a new instance of the ResourceAutoGenerated2 class. - /// - public ResourceAutoGenerated2() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceAutoGenerated2 class. - /// - - /// Fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - - /// The name of the resource - /// - - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - - /// Azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - public ResourceAutoGenerated2(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - - { - this.Id = id; - this.Name = name; - this.Type = type; - this.SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets fully qualified resource ID for the resource. E.g. - /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; private set; } - - /// - /// Gets the name of the resource - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; private set; } - - /// - /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type {get; private set; } - - /// - /// Gets azure Resource Manager metadata containing createdBy and modifiedBy - /// information. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] - public SystemData SystemData {get; private set; } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountGetResult.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountGetResult.cs index 072564fdcca8..231e67b0d3c9 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountGetResult.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountGetResult.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// A Azure Cosmos DB restorable database account. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class RestorableDatabaseAccountGetResult + public partial class RestorableDatabaseAccountGetResult : ProxyResource { /// /// Initializes a new instance of the RestorableDatabaseAccountGetResult class. @@ -25,13 +25,19 @@ public RestorableDatabaseAccountGetResult() /// Initializes a new instance of the RestorableDatabaseAccountGetResult class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// The location of the resource group to which the resource belongs. @@ -47,28 +53,26 @@ public RestorableDatabaseAccountGetResult() /// The creation time of the restorable database account (ISO-8601 format). /// - /// The time at which the restorable database account has been deleted + /// The least recent time at which the database account can be restored to /// (ISO-8601 format). /// - /// The least recent time at which the database account can be restored to + /// The time at which the restorable database account has been deleted /// (ISO-8601 format). /// /// List of regions where the of the database account can be restored from. /// - public RestorableDatabaseAccountGetResult(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string apiType = default(string), string accountName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?), System.DateTime? oldestRestorableTime = default(System.DateTime?), System.Collections.Generic.IList restorableLocations = default(System.Collections.Generic.IList)) + public RestorableDatabaseAccountGetResult(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), string apiType = default(string), string accountName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? oldestRestorableTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?), System.Collections.Generic.IList restorableLocations = default(System.Collections.Generic.IList)) + : base(id, name, type, systemData) { - this.Id = id; - this.Name = name; - this.Type = type; this.Location = location; this.ApiType = apiType; this.AccountName = accountName; this.CreationTime = creationTime; - this.DeletionTime = deletionTime; this.OldestRestorableTime = oldestRestorableTime; + this.DeletionTime = deletionTime; this.RestorableLocations = restorableLocations; CustomInit(); } @@ -79,24 +83,6 @@ public RestorableDatabaseAccountGetResult() partial void CustomInit(); - /// - /// Gets the unique resource identifier of the ARM resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; private set; } - - /// - /// Gets the name of the ARM resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; private set; } - - /// - /// Gets the type of Azure resource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type {get; private set; } - /// /// Gets or sets the location of the resource group to which the resource /// belongs. @@ -123,13 +109,6 @@ public RestorableDatabaseAccountGetResult() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.creationTime")] public System.DateTime? CreationTime {get; set; } - /// - /// Gets or sets the time at which the restorable database account has been - /// deleted (ISO-8601 format). - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deletionTime")] - public System.DateTime? DeletionTime {get; set; } - /// /// Gets or sets the least recent time at which the database account can be /// restored to (ISO-8601 format). @@ -137,6 +116,13 @@ public RestorableDatabaseAccountGetResult() [Newtonsoft.Json.JsonProperty(PropertyName = "properties.oldestRestorableTime")] public System.DateTime? OldestRestorableTime {get; set; } + /// + /// Gets or sets the time at which the restorable database account has been + /// deleted (ISO-8601 format). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.deletionTime")] + public System.DateTime? DeletionTime {get; set; } + /// /// Gets list of regions where the of the database account can be restored /// from. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountProperties.cs index 15f487b5beaf..6e3dadf461e7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableDatabaseAccountProperties.cs @@ -30,11 +30,11 @@ public RestorableDatabaseAccountProperties() /// The creation time of the restorable database account (ISO-8601 format). /// - /// The time at which the restorable database account has been deleted + /// The least recent time at which the database account can be restored to /// (ISO-8601 format). /// - /// The least recent time at which the database account can be restored to + /// The time at which the restorable database account has been deleted /// (ISO-8601 format). /// @@ -44,13 +44,13 @@ public RestorableDatabaseAccountProperties() /// List of regions where the of the database account can be restored from. /// - public RestorableDatabaseAccountProperties(string accountName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?), System.DateTime? oldestRestorableTime = default(System.DateTime?), string apiType = default(string), System.Collections.Generic.IList restorableLocations = default(System.Collections.Generic.IList)) + public RestorableDatabaseAccountProperties(string accountName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? oldestRestorableTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?), string apiType = default(string), System.Collections.Generic.IList restorableLocations = default(System.Collections.Generic.IList)) { this.AccountName = accountName; this.CreationTime = creationTime; - this.DeletionTime = deletionTime; this.OldestRestorableTime = oldestRestorableTime; + this.DeletionTime = deletionTime; this.ApiType = apiType; this.RestorableLocations = restorableLocations; CustomInit(); @@ -75,13 +75,6 @@ public RestorableDatabaseAccountProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "creationTime")] public System.DateTime? CreationTime {get; set; } - /// - /// Gets or sets the time at which the restorable database account has been - /// deleted (ISO-8601 format). - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "deletionTime")] - public System.DateTime? DeletionTime {get; set; } - /// /// Gets or sets the least recent time at which the database account can be /// restored to (ISO-8601 format). @@ -89,6 +82,13 @@ public RestorableDatabaseAccountProperties() [Newtonsoft.Json.JsonProperty(PropertyName = "oldestRestorableTime")] public System.DateTime? OldestRestorableTime {get; set; } + /// + /// Gets or sets the time at which the restorable database account has been + /// deleted (ISO-8601 format). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "deletionTime")] + public System.DateTime? DeletionTime {get; set; } + /// /// Gets the API type of the restorable database account. Possible values include: 'MongoDB', 'Gremlin', 'Cassandra', 'Table', 'Sql', 'GremlinV2' /// diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index 378ed50e4057..372a69817a48 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// Cosmos DB SQL container resource object /// - public partial class RestorableSqlContainerPropertiesResourceContainer + public partial class RestorableSqlContainerPropertiesResourceContainer : SqlContainerResource { /// /// Initializes a new instance of the RestorableSqlContainerPropertiesResourceContainer class. @@ -54,7 +54,7 @@ public RestorableSqlContainerPropertiesResourceContainer() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// List of computed properties @@ -82,20 +82,8 @@ public RestorableSqlContainerPropertiesResourceContainer() /// public RestorableSqlContainerPropertiesResourceContainer(string id, IndexingPolicy indexingPolicy = default(IndexingPolicy), ContainerPartitionKey partitionKey = default(ContainerPartitionKey), int? defaultTtl = default(int?), UniqueKeyPolicy uniqueKeyPolicy = default(UniqueKeyPolicy), ConflictResolutionPolicy conflictResolutionPolicy = default(ConflictResolutionPolicy), ClientEncryptionPolicy clientEncryptionPolicy = default(ClientEncryptionPolicy), long? analyticalStorageTtl = default(long?), ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), System.Collections.Generic.IList computedProperties = default(System.Collections.Generic.IList), VectorEmbeddingPolicy vectorEmbeddingPolicy = default(VectorEmbeddingPolicy), FullTextPolicy fullTextPolicy = default(FullTextPolicy), string rid = default(string), double? ts = default(double?), string etag = default(string), string self = default(string)) + : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, fullTextPolicy) { - this.Id = id; - this.IndexingPolicy = indexingPolicy; - this.PartitionKey = partitionKey; - this.DefaultTtl = defaultTtl; - this.UniqueKeyPolicy = uniqueKeyPolicy; - this.ConflictResolutionPolicy = conflictResolutionPolicy; - this.ClientEncryptionPolicy = clientEncryptionPolicy; - this.AnalyticalStorageTtl = analyticalStorageTtl; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; - this.ComputedProperties = computedProperties; - this.VectorEmbeddingPolicy = vectorEmbeddingPolicy; - this.FullTextPolicy = fullTextPolicy; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -109,87 +97,6 @@ public RestorableSqlContainerPropertiesResourceContainer() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL container - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets the configuration of the indexing policy. By default, the - /// indexing is automatic for all document paths within the container - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "indexingPolicy")] - public IndexingPolicy IndexingPolicy {get; set; } - - /// - /// Gets or sets the configuration of the partition key to be used for - /// partitioning data into multiple partitions - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "partitionKey")] - public ContainerPartitionKey PartitionKey {get; set; } - - /// - /// Gets or sets default time to live - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultTtl")] - public int? DefaultTtl {get; set; } - - /// - /// Gets or sets the unique key policy configuration for specifying uniqueness - /// constraints on documents in the collection in the Azure Cosmos DB service. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueKeyPolicy")] - public UniqueKeyPolicy UniqueKeyPolicy {get; set; } - - /// - /// Gets or sets the conflict resolution policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "conflictResolutionPolicy")] - public ConflictResolutionPolicy ConflictResolutionPolicy {get; set; } - - /// - /// Gets or sets the client encryption policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "clientEncryptionPolicy")] - public ClientEncryptionPolicy ClientEncryptionPolicy {get; set; } - - /// - /// Gets or sets analytical TTL. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "analyticalStorageTtl")] - public long? AnalyticalStorageTtl {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - - /// - /// Gets or sets list of computed properties - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "computedProperties")] - public System.Collections.Generic.IList ComputedProperties {get; set; } - - /// - /// Gets or sets the vector embedding policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vectorEmbeddingPolicy")] - public VectorEmbeddingPolicy VectorEmbeddingPolicy {get; set; } - - /// - /// Gets or sets the FullText policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fullTextPolicy")] - public FullTextPolicy FullTextPolicy {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -222,29 +129,9 @@ public RestorableSqlContainerPropertiesResourceContainer() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - if (this.PartitionKey != null) - { - this.PartitionKey.Validate(); - } - - - if (this.ClientEncryptionPolicy != null) - { - this.ClientEncryptionPolicy.Validate(); - } - - - - - + base.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs index ec522092e591..c3168ae3be82 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// Cosmos DB SQL database resource object /// - public partial class RestorableSqlDatabasePropertiesResourceDatabase + public partial class RestorableSqlDatabasePropertiesResourceDatabase : SqlDatabaseResource { /// /// Initializes a new instance of the RestorableSqlDatabasePropertiesResourceDatabase class. @@ -30,7 +30,7 @@ public RestorableSqlDatabasePropertiesResourceDatabase() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// A system generated property. A unique identifier. @@ -57,10 +57,8 @@ public RestorableSqlDatabasePropertiesResourceDatabase() /// public RestorableSqlDatabasePropertiesResourceDatabase(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string), string colls = default(string), string users = default(string), string self = default(string)) + : base(id, restoreParameters, createMode) { - this.Id = id; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -76,24 +74,6 @@ public RestorableSqlDatabasePropertiesResourceDatabase() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL database - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -140,15 +120,9 @@ public RestorableSqlDatabasePropertiesResourceDatabase() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - + base.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ScheduledEventStrategy.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ScheduledEventStrategy.cs new file mode 100644 index 000000000000..3ea5aad8b557 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ScheduledEventStrategy.cs @@ -0,0 +1,20 @@ +// 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 +{ + + /// + /// Defines values for ScheduledEventStrategy. + /// + + + public static class ScheduledEventStrategy + { + public const string Ignore = "Ignore"; + public const string StopAny = "StopAny"; + public const string StopByRack = "StopByRack"; + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceCreateHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceCreateHeaders.cs index ab809ce66f6f..208d56316e74 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceCreateHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceCreateHeaders.cs @@ -21,16 +21,16 @@ public ServiceCreateHeaders() /// Initializes a new instance of the ServiceCreateHeaders class. /// - /// + /// /// - /// + /// /// - public ServiceCreateHeaders(string azureAsyncOperation = default(string), string location = default(string)) + public ServiceCreateHeaders(string location = default(string), int? retryAfter = default(int?)) { - this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +43,13 @@ public ServiceCreateHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] - public string AzureAsyncOperation {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceDeleteHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceDeleteHeaders.cs index 51f346902d30..fc9a074bec46 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceDeleteHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceDeleteHeaders.cs @@ -43,13 +43,13 @@ public ServiceDeleteHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceResource.cs index cd56e82f325d..18fb8d6218fc 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ServiceResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// /// Properties for the database account. /// - public partial class ServiceResource : ARMProxyResource + public partial class ServiceResource : ProxyResource { /// /// Initializes a new instance of the ServiceResource class. @@ -24,20 +24,26 @@ public ServiceResource() /// Initializes a new instance of the ServiceResource class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Services response resource. /// - public ServiceResource(string id = default(string), string name = default(string), string type = default(string), ServiceResourceProperties properties = default(ServiceResourceProperties)) + public ServiceResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ServiceResourceProperties properties = default(ServiceResourceProperties)) - : base(id, name, type) + : base(id, name, type, systemData) { this.Properties = properties; CustomInit(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerCreateUpdateParameters.cs index 8216cea8d1c1..a8a747533620 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public SqlContainerCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a container /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public SqlContainerCreateUpdateParameters(SqlContainerResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public SqlContainerCreateUpdateParameters(SqlContainerResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetPropertiesResource.cs index 3a0ca3fd8ec6..6c5ad0f40cc7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class SqlContainerGetPropertiesResource + public partial class SqlContainerGetPropertiesResource : SqlContainerResource { /// /// Initializes a new instance of the SqlContainerGetPropertiesResource class. @@ -51,7 +51,7 @@ public SqlContainerGetPropertiesResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// List of computed properties @@ -75,20 +75,8 @@ public SqlContainerGetPropertiesResource() /// public SqlContainerGetPropertiesResource(string id, IndexingPolicy indexingPolicy = default(IndexingPolicy), ContainerPartitionKey partitionKey = default(ContainerPartitionKey), int? defaultTtl = default(int?), UniqueKeyPolicy uniqueKeyPolicy = default(UniqueKeyPolicy), ConflictResolutionPolicy conflictResolutionPolicy = default(ConflictResolutionPolicy), ClientEncryptionPolicy clientEncryptionPolicy = default(ClientEncryptionPolicy), long? analyticalStorageTtl = default(long?), ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), System.Collections.Generic.IList computedProperties = default(System.Collections.Generic.IList), VectorEmbeddingPolicy vectorEmbeddingPolicy = default(VectorEmbeddingPolicy), FullTextPolicy fullTextPolicy = default(FullTextPolicy), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, computedProperties, vectorEmbeddingPolicy, fullTextPolicy) { - this.Id = id; - this.IndexingPolicy = indexingPolicy; - this.PartitionKey = partitionKey; - this.DefaultTtl = defaultTtl; - this.UniqueKeyPolicy = uniqueKeyPolicy; - this.ConflictResolutionPolicy = conflictResolutionPolicy; - this.ClientEncryptionPolicy = clientEncryptionPolicy; - this.AnalyticalStorageTtl = analyticalStorageTtl; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; - this.ComputedProperties = computedProperties; - this.VectorEmbeddingPolicy = vectorEmbeddingPolicy; - this.FullTextPolicy = fullTextPolicy; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -101,87 +89,6 @@ public SqlContainerGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL container - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets the configuration of the indexing policy. By default, the - /// indexing is automatic for all document paths within the container - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "indexingPolicy")] - public IndexingPolicy IndexingPolicy {get; set; } - - /// - /// Gets or sets the configuration of the partition key to be used for - /// partitioning data into multiple partitions - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "partitionKey")] - public ContainerPartitionKey PartitionKey {get; set; } - - /// - /// Gets or sets default time to live - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultTtl")] - public int? DefaultTtl {get; set; } - - /// - /// Gets or sets the unique key policy configuration for specifying uniqueness - /// constraints on documents in the collection in the Azure Cosmos DB service. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "uniqueKeyPolicy")] - public UniqueKeyPolicy UniqueKeyPolicy {get; set; } - - /// - /// Gets or sets the conflict resolution policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "conflictResolutionPolicy")] - public ConflictResolutionPolicy ConflictResolutionPolicy {get; set; } - - /// - /// Gets or sets the client encryption policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "clientEncryptionPolicy")] - public ClientEncryptionPolicy ClientEncryptionPolicy {get; set; } - - /// - /// Gets or sets analytical TTL. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "analyticalStorageTtl")] - public long? AnalyticalStorageTtl {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - - /// - /// Gets or sets list of computed properties - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "computedProperties")] - public System.Collections.Generic.IList ComputedProperties {get; set; } - - /// - /// Gets or sets the vector embedding policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "vectorEmbeddingPolicy")] - public VectorEmbeddingPolicy VectorEmbeddingPolicy {get; set; } - - /// - /// Gets or sets the FullText policy for the container. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "fullTextPolicy")] - public FullTextPolicy FullTextPolicy {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -207,29 +114,9 @@ public SqlContainerGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - if (this.PartitionKey != null) - { - this.PartitionKey.Validate(); - } - - - if (this.ClientEncryptionPolicy != null) - { - this.ClientEncryptionPolicy.Validate(); - } - - - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetResults.cs index 102282c78c89..7875e18e4271 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB container. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlContainerGetResults : ARMResourceProperties + public partial class SqlContainerGetResults : Resource { /// /// Initializes a new instance of the SqlContainerGetResults class. @@ -25,25 +25,28 @@ public SqlContainerGetResults() /// Initializes a new instance of the SqlContainerGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public SqlContainerGetResults() /// /// - public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource), SqlContainerGetPropertiesOptions options = default(SqlContainerGetPropertiesOptions)) + public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource), SqlContainerGetPropertiesOptions options = default(SqlContainerGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public SqlContainerGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public SqlContainerGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerResource.cs index 51d21bc092e0..79bcb28835ea 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlContainerResource.cs @@ -54,7 +54,7 @@ public SqlContainerResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// List of computed properties @@ -148,7 +148,7 @@ public SqlContainerResource() public ResourceRestoreParameters RestoreParameters {get; set; } /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' + /// Gets or sets enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' /// [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] public string CreateMode {get; set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseCreateUpdateParameters.cs index fdef2f752e6f..1ede0c8bee70 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public SqlDatabaseCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a SQL database /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public SqlDatabaseCreateUpdateParameters(SqlDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public SqlDatabaseCreateUpdateParameters(SqlDatabaseResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetPropertiesResource.cs index 5d0af551c7d7..e1ee32b22a68 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class SqlDatabaseGetPropertiesResource + public partial class SqlDatabaseGetPropertiesResource : SqlDatabaseResource { /// /// Initializes a new instance of the SqlDatabaseGetPropertiesResource class. @@ -27,7 +27,7 @@ public SqlDatabaseGetPropertiesResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// A system generated property. A unique identifier. @@ -50,10 +50,8 @@ public SqlDatabaseGetPropertiesResource() /// public SqlDatabaseGetPropertiesResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string), string colls = default(string), string users = default(string)) + : base(id, restoreParameters, createMode) { - this.Id = id; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -68,24 +66,6 @@ public SqlDatabaseGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL database - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -125,15 +105,9 @@ public SqlDatabaseGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - + base.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetResults.cs index 53436e6b8520..8c3e594b9c2c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB SQL database. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlDatabaseGetResults : ARMResourceProperties + public partial class SqlDatabaseGetResults : Resource { /// /// Initializes a new instance of the SqlDatabaseGetResults class. @@ -25,25 +25,28 @@ public SqlDatabaseGetResults() /// Initializes a new instance of the SqlDatabaseGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public SqlDatabaseGetResults() /// /// - public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource), SqlDatabaseGetPropertiesOptions options = default(SqlDatabaseGetPropertiesOptions)) + public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource), SqlDatabaseGetPropertiesOptions options = default(SqlDatabaseGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public SqlDatabaseGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public SqlDatabaseGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseResource.cs index d8b61f03c764..8d80a930f839 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDatabaseResource.cs @@ -30,7 +30,7 @@ public SqlDatabaseResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' public SqlDatabaseResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string)) @@ -60,7 +60,7 @@ public SqlDatabaseResource() public ResourceRestoreParameters RestoreParameters {get; set; } /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' + /// Gets or sets enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' /// [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] public string CreateMode {get; set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDedicatedGatewayServiceResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDedicatedGatewayServiceResource.cs deleted file mode 100644 index aceb46d66de4..000000000000 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlDedicatedGatewayServiceResource.cs +++ /dev/null @@ -1,61 +0,0 @@ -// 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; - - /// - /// Describes the service response property for SqlDedicatedGateway. - /// - public partial class SqlDedicatedGatewayServiceResource - { - /// - /// Initializes a new instance of the SqlDedicatedGatewayServiceResource class. - /// - public SqlDedicatedGatewayServiceResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SqlDedicatedGatewayServiceResource class. - /// - - /// Properties for SqlDedicatedGatewayServiceResource. - /// - public SqlDedicatedGatewayServiceResource(SqlDedicatedGatewayServiceResourceProperties properties = default(SqlDedicatedGatewayServiceResourceProperties)) - - { - this.Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets properties for SqlDedicatedGatewayServiceResource. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public SqlDedicatedGatewayServiceResourceProperties Properties {get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.Properties != null) - { - this.Properties.Validate(); - } - } - } -} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateClientEncryptionKeyHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateClientEncryptionKeyHeaders.cs index e5061ada4b2e..573d5dc5e646 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateClientEncryptionKeyHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateClientEncryptionKeyHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateClientEncryptionKeyHeaders() /// /// - public SqlResourcesCreateUpdateClientEncryptionKeyHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateClientEncryptionKeyHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateClientEncryptionKeyHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlContainerHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlContainerHeaders.cs index 191bdb319466..c9f767fe4238 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlContainerHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlContainerHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateSqlContainerHeaders() /// /// - public SqlResourcesCreateUpdateSqlContainerHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateSqlContainerHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateSqlContainerHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlDatabaseHeaders.cs index 4aab251e4e48..75b5596d4bbb 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlDatabaseHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateSqlDatabaseHeaders() /// /// - public SqlResourcesCreateUpdateSqlDatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateSqlDatabaseHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateSqlDatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..01c42e696efb --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleAssignmentHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 SqlResourcesCreateUpdateSqlRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the SqlResourcesCreateUpdateSqlRoleAssignmentHeaders class. + /// + public SqlResourcesCreateUpdateSqlRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlResourcesCreateUpdateSqlRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + public SqlResourcesCreateUpdateSqlRoleAssignmentHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..e573ca54891b --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 SqlResourcesCreateUpdateSqlRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the SqlResourcesCreateUpdateSqlRoleDefinitionHeaders class. + /// + public SqlResourcesCreateUpdateSqlRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlResourcesCreateUpdateSqlRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public SqlResourcesCreateUpdateSqlRoleDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlStoredProcedureHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlStoredProcedureHeaders.cs index f344939cec18..903bea6eb782 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlStoredProcedureHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlStoredProcedureHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateSqlStoredProcedureHeaders() /// /// - public SqlResourcesCreateUpdateSqlStoredProcedureHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateSqlStoredProcedureHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateSqlStoredProcedureHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlTriggerHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlTriggerHeaders.cs index fc8fb74a0473..66d98ae88103 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlTriggerHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlTriggerHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateSqlTriggerHeaders() /// /// - public SqlResourcesCreateUpdateSqlTriggerHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateSqlTriggerHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateSqlTriggerHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders.cs index e06b9601f4ea..30b657d675e0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders() /// /// - public SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesCreateUpdateSqlUserDefinedFunctionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlContainerHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlContainerHeaders.cs index dd430b8df4f6..57ed9a3d5f69 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlContainerHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlContainerHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesDeleteSqlContainerHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlDatabaseHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlDatabaseHeaders.cs index 171ea3b53a5e..53d2784b9465 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlDatabaseHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlDatabaseHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesDeleteSqlDatabaseHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleAssignmentHeaders.cs new file mode 100644 index 000000000000..e1ffcbf94ac3 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleAssignmentHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 SqlResourcesDeleteSqlRoleAssignmentHeaders + { + /// + /// Initializes a new instance of the SqlResourcesDeleteSqlRoleAssignmentHeaders class. + /// + public SqlResourcesDeleteSqlRoleAssignmentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlResourcesDeleteSqlRoleAssignmentHeaders class. + /// + + /// + /// + + /// + /// + public SqlResourcesDeleteSqlRoleAssignmentHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleDefinitionHeaders.cs new file mode 100644 index 000000000000..6e4e72551d67 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlRoleDefinitionHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 SqlResourcesDeleteSqlRoleDefinitionHeaders + { + /// + /// Initializes a new instance of the SqlResourcesDeleteSqlRoleDefinitionHeaders class. + /// + public SqlResourcesDeleteSqlRoleDefinitionHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlResourcesDeleteSqlRoleDefinitionHeaders class. + /// + + /// + /// + + /// + /// + public SqlResourcesDeleteSqlRoleDefinitionHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlStoredProcedureHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlStoredProcedureHeaders.cs index d51fa23cb973..a5ad868087af 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlStoredProcedureHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlStoredProcedureHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesDeleteSqlStoredProcedureHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlTriggerHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlTriggerHeaders.cs index 7f41028c96ec..2693da5e76b1 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlTriggerHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlTriggerHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesDeleteSqlTriggerHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlUserDefinedFunctionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlUserDefinedFunctionHeaders.cs index 5639b244a3cc..d803575f9bf0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlUserDefinedFunctionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesDeleteSqlUserDefinedFunctionHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesDeleteSqlUserDefinedFunctionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToAutoscaleHeaders.cs index ac555959611f..91d849eb2b32 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToAutoscaleHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesMigrateSqlContainerToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToManualThroughputHeaders.cs index 79c80fac200d..512c1b7a0795 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlContainerToManualThroughputHeaders.cs @@ -43,13 +43,13 @@ public SqlResourcesMigrateSqlContainerToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders.cs index 9e23e95f3173..3fb26faa6fdc 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders() /// /// - public SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesMigrateSqlDatabaseToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders.cs index b8bb9323a133..90423caa9ec0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders() /// /// - public SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesMigrateSqlDatabaseToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesRetrieveContinuousBackupInformationHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesRetrieveContinuousBackupInformationHeaders.cs new file mode 100644 index 000000000000..7684e76a76f9 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesRetrieveContinuousBackupInformationHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 SqlResourcesRetrieveContinuousBackupInformationHeaders + { + /// + /// Initializes a new instance of the SqlResourcesRetrieveContinuousBackupInformationHeaders class. + /// + public SqlResourcesRetrieveContinuousBackupInformationHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlResourcesRetrieveContinuousBackupInformationHeaders class. + /// + + /// + /// + + /// + /// + public SqlResourcesRetrieveContinuousBackupInformationHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlContainerThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlContainerThroughputHeaders.cs index 3b0c0eb16ced..1666eb53875c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlContainerThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlContainerThroughputHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesUpdateSqlContainerThroughputHeaders() /// /// - public SqlResourcesUpdateSqlContainerThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesUpdateSqlContainerThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesUpdateSqlContainerThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlDatabaseThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlDatabaseThroughputHeaders.cs index 7ee6b3c32cc8..7f415e078fba 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlDatabaseThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlResourcesUpdateSqlDatabaseThroughputHeaders.cs @@ -26,11 +26,15 @@ public SqlResourcesUpdateSqlDatabaseThroughputHeaders() /// /// - public SqlResourcesUpdateSqlDatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public SqlResourcesUpdateSqlDatabaseThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public SqlResourcesUpdateSqlDatabaseThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleAssignmentGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleAssignmentGetResults.cs index 2ab1af47f1c5..323dbac200bc 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleAssignmentGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleAssignmentGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Role Assignment /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlRoleAssignmentGetResults : ARMProxyResource + public partial class SqlRoleAssignmentGetResults : ProxyResource { /// /// Initializes a new instance of the SqlRoleAssignmentGetResults class. @@ -25,13 +25,19 @@ public SqlRoleAssignmentGetResults() /// Initializes a new instance of the SqlRoleAssignmentGetResults class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// The unique identifier for the associated Role Definition. @@ -46,9 +52,9 @@ public SqlRoleAssignmentGetResults() /// the principal is inferred using the tenant associated with the /// subscription. /// - public SqlRoleAssignmentGetResults(string id = default(string), string name = default(string), string type = default(string), string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string)) + public SqlRoleAssignmentGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleDefinitionId = default(string), string scope = default(string), string principalId = default(string)) - : base(id, name, type) + : base(id, name, type, systemData) { this.RoleDefinitionId = roleDefinitionId; this.Scope = scope; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleDefinitionGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleDefinitionGetResults.cs index d012bc3e36c8..eb286210df38 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleDefinitionGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlRoleDefinitionGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB SQL Role Definition. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlRoleDefinitionGetResults : ARMProxyResource + public partial class SqlRoleDefinitionGetResults : ProxyResource { /// /// Initializes a new instance of the SqlRoleDefinitionGetResults class. @@ -25,13 +25,19 @@ public SqlRoleDefinitionGetResults() /// Initializes a new instance of the SqlRoleDefinitionGetResults class. /// - /// The unique resource identifier of the database account. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the database account. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// A user-friendly name for the Role Definition. Must be unique for the @@ -51,9 +57,9 @@ public SqlRoleDefinitionGetResults() /// The set of operations allowed through this Role Definition. /// - public SqlRoleDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + public SqlRoleDefinitionGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) - : base(id, name, type) + : base(id, name, type, systemData) { this.RoleName = roleName; this.PropertiesType = propertiesType; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs index e049ff3556db..ca473bda3c31 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public SqlStoredProcedureCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a storedProcedure /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public SqlStoredProcedureCreateUpdateParameters(SqlStoredProcedureResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public SqlStoredProcedureCreateUpdateParameters(SqlStoredProcedureResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs index 9792f1f766e3..dd4710c0ed12 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class SqlStoredProcedureGetPropertiesResource + public partial class SqlStoredProcedureGetPropertiesResource : SqlStoredProcedureResource { /// /// Initializes a new instance of the SqlStoredProcedureGetPropertiesResource class. @@ -39,9 +39,8 @@ public SqlStoredProcedureGetPropertiesResource() /// public SqlStoredProcedureGetPropertiesResource(string id, string body = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, body) { - this.Id = id; - this.Body = body; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -54,18 +53,6 @@ public SqlStoredProcedureGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL storedProcedure - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets body of the Stored Procedure - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "body")] - public string Body {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -91,14 +78,9 @@ public SqlStoredProcedureGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetResults.cs index 2d76811096aa..1fa59207efe0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlStoredProcedureGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB storedProcedure. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlStoredProcedureGetResults : ARMResourceProperties + public partial class SqlStoredProcedureGetResults : Resource { /// /// Initializes a new instance of the SqlStoredProcedureGetResults class. @@ -25,33 +25,39 @@ public SqlStoredProcedureGetResults() /// Initializes a new instance of the SqlStoredProcedureGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// /// - public SqlStoredProcedureGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SqlStoredProcedureGetPropertiesResource resource = default(SqlStoredProcedureGetPropertiesResource)) + public SqlStoredProcedureGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SqlStoredProcedureGetPropertiesResource resource = default(SqlStoredProcedureGetPropertiesResource)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; CustomInit(); } @@ -62,6 +68,24 @@ public SqlStoredProcedureGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -75,6 +99,9 @@ public SqlStoredProcedureGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerCreateUpdateParameters.cs index de7d7971494e..31b9dbe0b9ca 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public SqlTriggerCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a trigger /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public SqlTriggerCreateUpdateParameters(SqlTriggerResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public SqlTriggerCreateUpdateParameters(SqlTriggerResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetPropertiesResource.cs index a7352401c229..7e30689d3a31 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class SqlTriggerGetPropertiesResource + public partial class SqlTriggerGetPropertiesResource : SqlTriggerResource { /// /// Initializes a new instance of the SqlTriggerGetPropertiesResource class. @@ -45,11 +45,8 @@ public SqlTriggerGetPropertiesResource() /// public SqlTriggerGetPropertiesResource(string id, string body = default(string), string triggerType = default(string), string triggerOperation = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, body, triggerType, triggerOperation) { - this.Id = id; - this.Body = body; - this.TriggerType = triggerType; - this.TriggerOperation = triggerOperation; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -62,30 +59,6 @@ public SqlTriggerGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL trigger - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets body of the Trigger - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "body")] - public string Body {get; set; } - - /// - /// Gets or sets type of the Trigger Possible values include: 'Pre', 'Post' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "triggerType")] - public string TriggerType {get; set; } - - /// - /// Gets or sets the operation the trigger is associated with Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "triggerOperation")] - public string TriggerOperation {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -111,16 +84,9 @@ public SqlTriggerGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetResults.cs index 320986642133..3547e00c7eaa 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlTriggerGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB trigger. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlTriggerGetResults : ARMResourceProperties + public partial class SqlTriggerGetResults : Resource { /// /// Initializes a new instance of the SqlTriggerGetResults class. @@ -25,33 +25,39 @@ public SqlTriggerGetResults() /// Initializes a new instance of the SqlTriggerGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// /// - public SqlTriggerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SqlTriggerGetPropertiesResource resource = default(SqlTriggerGetPropertiesResource)) + public SqlTriggerGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SqlTriggerGetPropertiesResource resource = default(SqlTriggerGetPropertiesResource)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; CustomInit(); } @@ -62,6 +68,24 @@ public SqlTriggerGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -75,6 +99,9 @@ public SqlTriggerGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs index b5d5fe98e039..7c9e25fc2b90 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public SqlUserDefinedFunctionCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a userDefinedFunction /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public SqlUserDefinedFunctionCreateUpdateParameters(SqlUserDefinedFunctionResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public SqlUserDefinedFunctionCreateUpdateParameters(SqlUserDefinedFunctionResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs index 92c72f94c8be..8abf0a72111c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class SqlUserDefinedFunctionGetPropertiesResource + public partial class SqlUserDefinedFunctionGetPropertiesResource : SqlUserDefinedFunctionResource { /// /// Initializes a new instance of the SqlUserDefinedFunctionGetPropertiesResource class. @@ -39,9 +39,8 @@ public SqlUserDefinedFunctionGetPropertiesResource() /// public SqlUserDefinedFunctionGetPropertiesResource(string id, string body = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, body) { - this.Id = id; - this.Body = body; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -54,18 +53,6 @@ public SqlUserDefinedFunctionGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB SQL userDefinedFunction - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets body of the User Defined Function - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "body")] - public string Body {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -91,14 +78,9 @@ public SqlUserDefinedFunctionGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetResults.cs index b8d4656981f0..44a27f3ee6c4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/SqlUserDefinedFunctionGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB userDefinedFunction. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class SqlUserDefinedFunctionGetResults : ARMResourceProperties + public partial class SqlUserDefinedFunctionGetResults : Resource { /// /// Initializes a new instance of the SqlUserDefinedFunctionGetResults class. @@ -25,33 +25,39 @@ public SqlUserDefinedFunctionGetResults() /// Initializes a new instance of the SqlUserDefinedFunctionGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// /// - public SqlUserDefinedFunctionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), SqlUserDefinedFunctionGetPropertiesResource resource = default(SqlUserDefinedFunctionGetPropertiesResource)) + public SqlUserDefinedFunctionGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), SqlUserDefinedFunctionGetPropertiesResource resource = default(SqlUserDefinedFunctionGetPropertiesResource)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; CustomInit(); } @@ -62,6 +68,24 @@ public SqlUserDefinedFunctionGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -75,6 +99,9 @@ public SqlUserDefinedFunctionGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Status.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Status.cs index 4697c935c8d8..d04e80156639 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Status.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/Status.cs @@ -18,10 +18,10 @@ public static class Status public const string InternallyReady = "InternallyReady"; public const string Online = "Online"; public const string Deleting = "Deleting"; - public const string Creating = "Creating"; public const string Succeeded = "Succeeded"; public const string Failed = "Failed"; public const string Canceled = "Canceled"; public const string Updating = "Updating"; + public const string Creating = "Creating"; } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableCreateUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableCreateUpdateParameters.cs index 34d42afab20f..246629bedf3b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableCreateUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableCreateUpdateParameters.cs @@ -46,15 +46,18 @@ public TableCreateUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a Table /// /// A key-value pair of options to be applied for the request. This corresponds /// to the headers sent with the request. /// - public TableCreateUpdateParameters(TableResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), CreateUpdateOptions options = default(CreateUpdateOptions)) + public TableCreateUpdateParameters(TableResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity), CreateUpdateOptions options = default(CreateUpdateOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; this.Options = options; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetPropertiesResource.cs index 2467ea9d229f..8cdc142844fe 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class TableGetPropertiesResource + public partial class TableGetPropertiesResource : TableResource { /// /// Initializes a new instance of the TableGetPropertiesResource class. @@ -27,7 +27,7 @@ public TableGetPropertiesResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' /// A system generated property. A unique identifier. @@ -42,10 +42,8 @@ public TableGetPropertiesResource() /// public TableGetPropertiesResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(id, restoreParameters, createMode) { - this.Id = id; - this.RestoreParameters = restoreParameters; - this.CreateMode = createMode; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -58,24 +56,6 @@ public TableGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets name of the Cosmos DB table - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id {get; set; } - - /// - /// Gets or sets parameters to indicate the information about the restore - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "restoreParameters")] - public ResourceRestoreParameters RestoreParameters {get; set; } - - /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] - public string CreateMode {get; set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -101,15 +81,9 @@ public TableGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.Id == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Id"); - } - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetResults.cs index 9f79689ebde9..13af921a6592 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB Table. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class TableGetResults : ARMResourceProperties + public partial class TableGetResults : Resource { /// /// Initializes a new instance of the TableGetResults class. @@ -25,25 +25,28 @@ public TableGetResults() /// Initializes a new instance of the TableGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// @@ -51,10 +54,13 @@ public TableGetResults() /// /// - public TableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), TableGetPropertiesResource resource = default(TableGetPropertiesResource), TableGetPropertiesOptions options = default(TableGetPropertiesOptions)) + public TableGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), TableGetPropertiesResource resource = default(TableGetPropertiesResource), TableGetPropertiesOptions options = default(TableGetPropertiesOptions)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; this.Options = options; CustomInit(); @@ -66,6 +72,24 @@ public TableGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -85,6 +109,9 @@ public TableGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResource.cs index 43ee8ee8f8a5..c7f39998b56c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResource.cs @@ -30,7 +30,7 @@ public TableResource() /// Parameters to indicate the information about the restore /// - /// Enum to indicate the mode of resource creation. + /// Enum to indicate the mode of account creation. /// Possible values include: 'Default', 'Restore' public TableResource(string id, ResourceRestoreParameters restoreParameters = default(ResourceRestoreParameters), string createMode = default(string)) @@ -60,7 +60,7 @@ public TableResource() public ResourceRestoreParameters RestoreParameters {get; set; } /// - /// Gets or sets enum to indicate the mode of resource creation. Possible values include: 'Default', 'Restore' + /// Gets or sets enum to indicate the mode of account creation. Possible values include: 'Default', 'Restore' /// [Newtonsoft.Json.JsonProperty(PropertyName = "createMode")] public string CreateMode {get; set; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableHeaders.cs index ac39320c1a43..2d0da17b54ef 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableHeaders.cs @@ -26,11 +26,15 @@ public TableResourcesCreateUpdateTableHeaders() /// /// - public TableResourcesCreateUpdateTableHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public TableResourcesCreateUpdateTableHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public TableResourcesCreateUpdateTableHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleAssignmentHeaders.cs index cbf62bc88ba5..39e733452715 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleAssignmentHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleAssignmentHeaders.cs @@ -26,11 +26,15 @@ public TableResourcesCreateUpdateTableRoleAssignmentHeaders() /// /// - public TableResourcesCreateUpdateTableRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public TableResourcesCreateUpdateTableRoleAssignmentHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public TableResourcesCreateUpdateTableRoleAssignmentHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleDefinitionHeaders.cs index cead02dd0c83..ea6f1fccd28f 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleDefinitionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesCreateUpdateTableRoleDefinitionHeaders.cs @@ -43,13 +43,13 @@ public TableResourcesCreateUpdateTableRoleDefinitionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableHeaders.cs index 86e3c5138612..180f618b11f0 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableHeaders.cs @@ -43,13 +43,13 @@ public TableResourcesDeleteTableHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleAssignmentHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleAssignmentHeaders.cs index 3f9b50e24880..7258a7cf19c3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleAssignmentHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleAssignmentHeaders.cs @@ -43,13 +43,13 @@ public TableResourcesDeleteTableRoleAssignmentHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleDefinitionHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleDefinitionHeaders.cs index a02f82ccbdba..be0bde41cbb4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleDefinitionHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesDeleteTableRoleDefinitionHeaders.cs @@ -43,13 +43,13 @@ public TableResourcesDeleteTableRoleDefinitionHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToAutoscaleHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToAutoscaleHeaders.cs index df5fa07552d7..9bcfbafffac3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToAutoscaleHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToAutoscaleHeaders.cs @@ -26,11 +26,15 @@ public TableResourcesMigrateTableToAutoscaleHeaders() /// /// - public TableResourcesMigrateTableToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public TableResourcesMigrateTableToAutoscaleHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public TableResourcesMigrateTableToAutoscaleHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToManualThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToManualThroughputHeaders.cs index 257ddb0e0f74..f3454a59a157 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToManualThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesMigrateTableToManualThroughputHeaders.cs @@ -26,11 +26,15 @@ public TableResourcesMigrateTableToManualThroughputHeaders() /// /// - public TableResourcesMigrateTableToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public TableResourcesMigrateTableToManualThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public TableResourcesMigrateTableToManualThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesRetrieveContinuousBackupInformationHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesRetrieveContinuousBackupInformationHeaders.cs new file mode 100644 index 000000000000..8561d212779f --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesRetrieveContinuousBackupInformationHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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 TableResourcesRetrieveContinuousBackupInformationHeaders + { + /// + /// Initializes a new instance of the TableResourcesRetrieveContinuousBackupInformationHeaders class. + /// + public TableResourcesRetrieveContinuousBackupInformationHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TableResourcesRetrieveContinuousBackupInformationHeaders class. + /// + + /// + /// + + /// + /// + public TableResourcesRetrieveContinuousBackupInformationHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesUpdateTableThroughputHeaders.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesUpdateTableThroughputHeaders.cs index 36caea446091..1d1c15c1e31a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesUpdateTableThroughputHeaders.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableResourcesUpdateTableThroughputHeaders.cs @@ -26,11 +26,15 @@ public TableResourcesUpdateTableThroughputHeaders() /// /// - public TableResourcesUpdateTableThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string)) + + /// + /// + public TableResourcesUpdateTableThroughputHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) { this.AzureAsyncOperation = azureAsyncOperation; this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -43,13 +47,19 @@ public TableResourcesUpdateTableThroughputHeaders() /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "azure-AsyncOperation")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] public string AzureAsyncOperation {get; set; } /// /// Gets or sets /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleAssignmentResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleAssignmentResource.cs index 6c57b2ac966c..11d656da3f0c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleAssignmentResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleAssignmentResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// Parameters to create and update an Azure Cosmos DB Table Role Assignment. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class TableRoleAssignmentResource : ProxyResourceAutoGenerated2 + public partial class TableRoleAssignmentResource : ProxyResource { /// /// Initializes a new instance of the TableRoleAssignmentResource class. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResource.cs index 926bf6f3dcbd..100d9cc755c6 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// Parameters to create and update an Azure Cosmos DB Table Role Definition. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class TableRoleDefinitionResource : ProxyResourceAutoGenerated2 + public partial class TableRoleDefinitionResource : ProxyResource { /// /// Initializes a new instance of the TableRoleDefinitionResource class. @@ -60,7 +60,7 @@ public TableRoleDefinitionResource() /// The set of operations allowed through this Role Definition. /// - public TableRoleDefinitionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string propertiesId = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + public TableRoleDefinitionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string propertiesId = default(string), string roleName = default(string), RoleDefinitionType? propertiesType = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) : base(id, name, type, systemData) { @@ -113,6 +113,6 @@ public TableRoleDefinitionResource() /// Gets or sets the set of operations allowed through this Role Definition. /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties.permissions")] - public System.Collections.Generic.IList Permissions {get; set; } + public System.Collections.Generic.IList Permissions {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResourceProperties.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResourceProperties.cs index e43a9536612b..9ec15c59b7e7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResourceProperties.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TableRoleDefinitionResourceProperties.cs @@ -44,7 +44,7 @@ public TableRoleDefinitionResourceProperties() /// The set of operations allowed through this Role Definition. /// - public TableRoleDefinitionResourceProperties(string id = default(string), string roleName = default(string), RoleDefinitionType? type = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) + public TableRoleDefinitionResourceProperties(string id = default(string), string roleName = default(string), RoleDefinitionType? type = default(RoleDefinitionType?), System.Collections.Generic.IList assignableScopes = default(System.Collections.Generic.IList), System.Collections.Generic.IList permissions = default(System.Collections.Generic.IList)) { this.Id = id; @@ -96,6 +96,6 @@ public TableRoleDefinitionResourceProperties() /// Gets or sets the set of operations allowed through this Role Definition. /// [Newtonsoft.Json.JsonProperty(PropertyName = "permissions")] - public System.Collections.Generic.IList Permissions {get; set; } + public System.Collections.Generic.IList Permissions {get; set; } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetPropertiesResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetPropertiesResource.cs index e55a98b50ddc..ef067760bc36 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetPropertiesResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetPropertiesResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models { using System.Linq; - public partial class ThroughputSettingsGetPropertiesResource + public partial class ThroughputSettingsGetPropertiesResource : ThroughputSettingsResource { /// /// Initializes a new instance of the ThroughputSettingsGetPropertiesResource class. @@ -54,13 +54,8 @@ public ThroughputSettingsGetPropertiesResource() /// public ThroughputSettingsGetPropertiesResource(int? throughput = default(int?), AutoscaleSettingsResource autoscaleSettings = default(AutoscaleSettingsResource), string minimumThroughput = default(string), string offerReplacePending = default(string), string instantMaximumThroughput = default(string), string softAllowedMaximumThroughput = default(string), string rid = default(string), double? ts = default(double?), string etag = default(string)) + : base(throughput, autoscaleSettings, minimumThroughput, offerReplacePending, instantMaximumThroughput, softAllowedMaximumThroughput) { - this.Throughput = throughput; - this.AutoscaleSettings = autoscaleSettings; - this.MinimumThroughput = minimumThroughput; - this.OfferReplacePending = offerReplacePending; - this.InstantMaximumThroughput = instantMaximumThroughput; - this.SoftAllowedMaximumThroughput = softAllowedMaximumThroughput; this.Rid = rid; this.Ts = ts; this.Etag = etag; @@ -73,46 +68,6 @@ public ThroughputSettingsGetPropertiesResource() partial void CustomInit(); - /// - /// Gets or sets value of the Cosmos DB resource throughput. Either throughput - /// is required or autoscaleSettings is required, but not both. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "throughput")] - public int? Throughput {get; set; } - - /// - /// Gets or sets cosmos DB resource for autoscale settings. Either throughput - /// is required or autoscaleSettings is required, but not both. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "autoscaleSettings")] - public AutoscaleSettingsResource AutoscaleSettings {get; set; } - - /// - /// Gets the minimum throughput of the resource - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "minimumThroughput")] - public string MinimumThroughput {get; private set; } - - /// - /// Gets the throughput replace is pending - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "offerReplacePending")] - public string OfferReplacePending {get; private set; } - - /// - /// Gets the offer throughput value to instantly scale up without triggering - /// splits - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "instantMaximumThroughput")] - public string InstantMaximumThroughput {get; private set; } - - /// - /// Gets the maximum throughput value or the maximum maxThroughput value (for - /// autoscale) that can be specified - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "softAllowedMaximumThroughput")] - public string SoftAllowedMaximumThroughput {get; private set; } - /// /// Gets a system generated property. A unique identifier. /// @@ -138,16 +93,9 @@ public ThroughputSettingsGetPropertiesResource() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (this.AutoscaleSettings != null) - { - this.AutoscaleSettings.Validate(); - } - - - - + base.Validate(); } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetResults.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetResults.cs index 482ac1df7339..dd8e861c514a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetResults.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsGetResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// An Azure Cosmos DB resource throughput. /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class ThroughputSettingsGetResults : ARMResourceProperties + public partial class ThroughputSettingsGetResults : Resource { /// /// Initializes a new instance of the ThroughputSettingsGetResults class. @@ -25,33 +25,39 @@ public ThroughputSettingsGetResults() /// Initializes a new instance of the ThroughputSettingsGetResults class. /// - /// The unique resource identifier of the ARM resource. + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// The name of the ARM resource. + /// The name of the resource /// - /// The type of Azure resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// The location of the resource group to which the resource belongs. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - /// Tags are a list of key-value pairs that describe the resource. These tags - /// can be used in viewing and grouping this resource (across resource groups). - /// A maximum of 15 tags can be provided for a resource. Each tag must have a - /// key no greater than 128 characters and value no greater than 256 - /// characters. For example, the default experience for a template type is set - /// with "defaultExperience": "Cassandra". Current "defaultExperience" values - /// also include "Table", "Graph", "DocumentDB", and "MongoDB". + /// Resource tags. + /// + + /// The geo-location where the resource lives + /// + + /// Identity for the resource. /// /// /// - public ThroughputSettingsGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ThroughputSettingsGetPropertiesResource resource = default(ThroughputSettingsGetPropertiesResource)) + public ThroughputSettingsGetResults(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ThroughputSettingsGetPropertiesResource resource = default(ThroughputSettingsGetPropertiesResource)) - : base(id, name, type, location, tags) + : base(id, name, type, systemData) { + this.Tags = tags; + this.Location = location; + this.Identity = identity; this.Resource = resource; CustomInit(); } @@ -62,6 +68,24 @@ public ThroughputSettingsGetResults() partial void CustomInit(); + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets identity for the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identity")] + public ManagedServiceIdentity Identity {get; set; } + /// /// Gets or sets /// @@ -75,6 +99,9 @@ public ThroughputSettingsGetResults() /// public virtual void Validate() { + + + if (this.Resource != null) { this.Resource.Validate(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsUpdateParameters.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsUpdateParameters.cs index 440b07ea4136..fd337d8a221f 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsUpdateParameters.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/ThroughputSettingsUpdateParameters.cs @@ -46,11 +46,14 @@ public ThroughputSettingsUpdateParameters() /// also include "Table", "Graph", "DocumentDB", and "MongoDB". /// + /// Identity for the resource. + /// + /// The standard JSON format of a resource throughput /// - public ThroughputSettingsUpdateParameters(ThroughputSettingsResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public ThroughputSettingsUpdateParameters(ThroughputSettingsResource resource, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) - : base(id, name, type, location, tags) + : base(id, name, type, location, tags, identity) { this.Resource = resource; CustomInit(); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TrackedResource.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TrackedResource.cs index 174e672e33ef..a2f15a7f0475 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TrackedResource.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Models/TrackedResource.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.Management.CosmosDB.Models /// The resource model definition for an Azure Resource Manager tracked top /// level resource which has 'tags' and a 'location' /// - public partial class TrackedResource : ResourceAutoGenerated + public partial class TrackedResource : Resource { /// /// Initializes a new instance of the TrackedResource class. diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperations.cs index f704eddfd3f0..7e1b8cff7012 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperations.cs @@ -69,23 +69,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMongoDBDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMongoDBDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -120,7 +115,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +124,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -140,14 +133,14 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -209,14 +202,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +218,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -242,7 +230,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -319,17 +307,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -369,7 +352,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -380,7 +362,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); @@ -390,15 +371,15 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -460,14 +441,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -477,10 +457,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -584,8 +560,8 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the RUs per second of the MongoDB database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -617,23 +593,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMongoDBCollectionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -673,7 +644,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -684,25 +654,24 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBCollections", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -764,14 +733,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -781,10 +749,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -797,7 +761,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -811,7 +775,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -835,88 +799,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// The RUs per second of the parameters to provide for the current MongoDB - /// database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// Gets the MongoDB collection under an existing Azure Cosmos DB database /// account. /// /// @@ -928,6 +811,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// Headers that will be added to request. /// @@ -949,23 +835,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMongoDBCollectionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1005,7 +886,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (collectionName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1016,25 +901,26 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("collectionName", collectionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBCollections", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollection", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1096,14 +982,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1113,10 +998,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1129,7 +1010,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1143,7 +1024,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1167,8 +1048,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The name of the resource group. The name is case insensitive. @@ -1182,46 +1062,132 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection name. /// + /// + /// The parameters to provide for the current MongoDB Collection. + /// /// /// 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 System.Threading.Tasks.Task> GetMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB collection name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// + /// Retrieves continuous backup information for a Mongodb collection. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB collection name. + /// + /// + /// The name of the continuous backup restore location. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { + /// + /// Gets the RUs per second of the MongoDB collection under an existing Azure + /// Cosmos DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB collection 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 System.Threading.Tasks.Task> GetMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) @@ -1264,7 +1230,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1276,26 +1241,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollectionThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1357,14 +1321,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1374,10 +1337,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1390,7 +1349,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1404,7 +1363,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1428,7 +1387,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The name of the resource group. The name is case insensitive. @@ -1442,8 +1401,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection name. /// - /// - /// The parameters to provide for the current MongoDB Collection. + /// + /// The RUs per second of the parameters to provide for the current MongoDB + /// collection. /// /// /// Headers that will be added to request. @@ -1451,15 +1411,16 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -1479,16 +1440,16 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the RUs per second of the MongoDB collection under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -1508,6 +1469,32 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// + public async System.Threading.Tasks.Task> MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the MongoDB database under an existing Azure + /// Cosmos DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// /// /// Thrown when the operation returned an invalid status code /// @@ -1523,23 +1510,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1579,12 +1561,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (collectionName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1595,27 +1571,24 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBCollectionThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoDBDatabaseThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1677,14 +1650,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1694,10 +1666,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1748,7 +1716,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The name of the resource group. The name is case insensitive. @@ -1759,12 +1727,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The RUs per second of the parameters to provide for the current MongoDB - /// collection. + /// database. /// /// /// Headers that will be added to request. @@ -1772,15 +1737,15 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// @@ -1792,24 +1757,21 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// @@ -1821,29 +1783,22 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role - /// Definition with the given Id. + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1871,28 +1826,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMongoRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (mongoRoleDefinitionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1927,7 +1872,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1935,28 +1879,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoRoleDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}").ToString(); - _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2051,7 +1992,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2065,7 +2006,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2089,67 +2030,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Mongo Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role + /// Definition with the given Id. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Definition. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB Mongo Role Definition. - /// /// /// The ID for the Role Definition {dbName.roleName}. /// - /// - /// 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. - /// - public async System.Threading.Tasks.Task DeleteMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// /// /// Headers that will be added to request. /// @@ -2171,23 +2063,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMongoRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2222,7 +2109,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (mongoRoleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2232,24 +2123,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoRoleDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2344,7 +2236,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2358,7 +2250,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2382,12 +2274,61 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo User - /// Definition with the given Id. + /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, createUpdateMongoRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Mongo Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. /// + public async System.Threading.Tasks.Task> DeleteMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// /// /// The name of the resource group. The name is case insensitive. /// @@ -2415,28 +2356,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMongoUserDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (mongoUserDefinitionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2471,7 +2402,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2479,28 +2409,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoUserDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoUserDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}").ToString(); - _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2595,7 +2522,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2609,7 +2536,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2633,67 +2560,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Mongo User Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo User + /// Definition with the given Id. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a User Definition. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB Mongo User Definition. - /// /// /// The ID for the User Definition {dbName.userName}. /// - /// - /// 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. - /// - public async System.Threading.Tasks.Task DeleteMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// /// /// Headers that will be added to request. /// @@ -2715,23 +2593,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMongoUserDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2766,7 +2639,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (mongoUserDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2776,24 +2653,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoUserDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoUserDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2888,7 +2766,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2902,7 +2780,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2926,7 +2804,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -2934,14 +2812,36 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The ID for the User Definition {dbName.userName}. /// - /// - /// Cosmos DB collection name. + /// + /// The properties required to create or update a User Definition. /// - /// - /// The name of the continuous backup restore location. + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, createUpdateMongoUserDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB Mongo User Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The ID for the User Definition {dbName.userName}. /// /// /// Headers that will be added to request. @@ -2949,10 +2849,10 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -3006,17 +2906,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { createUpdateMongoDBDatabaseParameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3056,7 +2951,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3067,7 +2961,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); @@ -3078,15 +2971,15 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3154,14 +3047,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3171,10 +3063,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3273,17 +3161,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3323,7 +3206,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3334,7 +3216,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); @@ -3344,15 +3225,15 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3414,14 +3295,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3431,10 +3311,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3480,7 +3356,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The name of the resource group. The name is case insensitive. @@ -3491,9 +3367,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// The RUs per second of the parameters to provide for the current MongoDB - /// database. + /// + /// Cosmos DB collection name. + /// + /// + /// The parameters to provide for the current MongoDB Collection. /// /// /// Headers that will be added to request. @@ -3516,31 +3394,26 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) + if (createUpdateMongoDBCollectionParameters == null) { - updateThroughputParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoDBCollectionParameters"); } - if (this.Client.SubscriptionId == null) + if (createUpdateMongoDBCollectionParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + createUpdateMongoDBCollectionParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3580,7 +3453,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (collectionName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3591,26 +3468,27 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); + tracingParameters.Add("createUpdateMongoDBCollectionParameters", createUpdateMongoDBCollectionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoDBCollection", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3648,9 +3526,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) + if(createUpdateMongoDBCollectionParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoDBCollectionParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -3678,14 +3556,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3695,10 +3572,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3711,7 +3584,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3725,7 +3598,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3739,7 +3612,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3762,8 +3635,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -3774,6 +3646,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// Headers that will be added to request. /// @@ -3783,9 +3658,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3795,23 +3667,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3851,7 +3718,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (collectionName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3862,25 +3733,26 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("collectionName", collectionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBDatabaseToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoDBCollection", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3889,7 +3761,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3940,16 +3812,15 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3959,10 +3830,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3975,7 +3842,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3983,27 +3850,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4026,8 +3875,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The name of the resource group. The name is case insensitive. @@ -4038,6 +3886,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// + /// + /// The name of the continuous backup restore location. + /// /// /// Headers that will be added to request. /// @@ -4059,23 +3913,23 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4115,7 +3969,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (collectionName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4126,25 +3984,27 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("collectionName", collectionName); + tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBDatabaseToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4182,6 +4042,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(location != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -4239,7 +4105,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4253,7 +4119,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4267,7 +4133,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4290,7 +4156,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The name of the resource group. The name is case insensitive. @@ -4304,8 +4170,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection name. /// - /// - /// The parameters to provide for the current MongoDB Collection. + /// + /// The RUs per second of the parameters to provide for the current MongoDB + /// collection. /// /// /// Headers that will be added to request. @@ -4328,31 +4195,26 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateMongoDBCollectionParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoDBCollectionParameters"); - } - if (createUpdateMongoDBCollectionParameters != null) + if (updateThroughputParameters == null) { - createUpdateMongoDBCollectionParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + updateThroughputParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4397,7 +4259,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4409,27 +4270,26 @@ 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("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoDBCollection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBCollectionThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4467,9 +4327,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateMongoDBCollectionParameters != null) + if(updateThroughputParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoDBCollectionParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -4497,14 +4357,13 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4514,10 +4373,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4530,7 +4385,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4544,7 +4399,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4558,7 +4413,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4581,7 +4436,8 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -4604,6 +4460,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4613,23 +4472,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteMongoDBCollectionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4674,7 +4528,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4686,26 +4539,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoDBCollection", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBCollectionToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4714,7 +4566,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4765,7 +4617,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -4800,7 +4652,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4808,9 +4660,27 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4833,7 +4703,8 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -4847,10 +4718,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB collection name. /// - /// - /// The RUs per second of the parameters to provide for the current MongoDB - /// collection. - /// /// /// Headers that will be added to request. /// @@ -4872,31 +4739,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) + if (this.Client.ApiVersion == null) { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4941,7 +4795,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4953,27 +4806,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBCollectionThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBCollectionToManualThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4982,7 +4833,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -5011,12 +4862,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -5074,7 +4919,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -5102,7 +4947,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -5125,8 +4970,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to - /// autoscale + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The name of the resource group. The name is case insensitive. @@ -5137,8 +4981,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. + /// + /// The RUs per second of the parameters to provide for the current MongoDB + /// database. /// /// /// Headers that will be added to request. @@ -5161,23 +5006,26 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId != null) + if (updateThroughputParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + updateThroughputParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5217,12 +5065,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (collectionName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5233,27 +5075,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBCollectionToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateMongoDBDatabaseThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5262,7 +5102,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -5291,6 +5131,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -5348,7 +5194,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -5376,7 +5222,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -5399,8 +5245,8 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -5411,9 +5257,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// Headers that will be added to request. /// @@ -5435,23 +5278,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5491,12 +5329,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (collectionName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5507,27 +5339,24 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBCollectionToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBDatabaseToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5622,7 +5451,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -5650,7 +5479,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -5673,19 +5502,17 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Mongo Role Definition. + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual + /// throughput /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// Cosmos DB database name. /// /// /// Headers that will be added to request. @@ -5708,33 +5535,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateMongoRoleDefinitionParameters == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoRoleDefinitionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (mongoRoleDefinitionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5769,7 +5581,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5777,29 +5593,27 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("createUpdateMongoRoleDefinitionParameters", createUpdateMongoRoleDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateMongoDBDatabaseToManualThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}").ToString(); - _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5808,7 +5622,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -5837,12 +5651,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateMongoRoleDefinitionParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoRoleDefinitionParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -5900,7 +5708,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -5914,7 +5722,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -5926,6 +5734,19 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -5938,17 +5759,20 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Mongo Role Definition. + /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + /// + /// The properties required to create or update a Role Definition. + /// /// /// Headers that will be added to request. /// @@ -5958,6 +5782,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -5967,28 +5794,23 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (mongoRoleDefinitionId == null) + if (createUpdateMongoRoleDefinitionParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoRoleDefinitionParameters"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6023,7 +5845,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (mongoRoleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6031,28 +5857,28 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); + tracingParameters.Add("createUpdateMongoRoleDefinitionParameters", createUpdateMongoRoleDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}").ToString(); - _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6061,7 +5887,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6090,6 +5916,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateMongoRoleDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoRoleDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -6112,7 +5944,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6147,7 +5979,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6155,6 +5987,37 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -6167,19 +6030,16 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Mongo User Definition. + /// Deletes an existing Azure Cosmos DB Mongo Role Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a User Definition. + /// + /// The ID for the Role Definition {dbName.roleName}. /// /// /// Headers that will be added to request. @@ -6190,9 +6050,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6202,33 +6059,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateMongoUserDefinitionParameters == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoUserDefinitionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (mongoUserDefinitionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6263,7 +6105,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (mongoRoleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoRoleDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6271,29 +6117,27 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoRoleDefinitionId", mongoRoleDefinitionId); - tracingParameters.Add("createUpdateMongoUserDefinitionParameters", createUpdateMongoUserDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoUserDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}").ToString(); - _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{mongoRoleDefinitionId}", System.Uri.EscapeDataString(mongoRoleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6302,7 +6146,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6331,12 +6175,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateMongoUserDefinitionParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoUserDefinitionParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -6359,7 +6197,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6394,7 +6232,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6402,23 +6240,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -6432,17 +6265,20 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Mongo User Definition. + /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// + /// + /// The properties required to create or update a User Definition. + /// /// /// Headers that will be added to request. /// @@ -6452,6 +6288,9 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -6461,28 +6300,23 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (mongoUserDefinitionId == null) + if (createUpdateMongoUserDefinitionParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoUserDefinitionParameters"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6517,7 +6351,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (mongoUserDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6525,28 +6363,28 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); + tracingParameters.Add("createUpdateMongoUserDefinitionParameters", createUpdateMongoUserDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoUserDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoUserDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}").ToString(); - _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6555,7 +6393,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6584,6 +6422,12 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateMongoUserDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoUserDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -6606,7 +6450,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6641,7 +6485,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6649,6 +6493,37 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -6661,7 +6536,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Deletes an existing Azure Cosmos DB Mongo User Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -6669,14 +6544,8 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB collection name. - /// - /// - /// The name of the continuous backup restore location. + /// + /// The ID for the User Definition {dbName.userName}. /// /// /// Headers that will be added to request. @@ -6687,9 +6556,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6699,28 +6565,18 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6755,17 +6611,11 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); - } - - if (collectionName == null) + if (mongoUserDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "collectionName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "mongoUserDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6775,29 +6625,25 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("collectionName", collectionName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("mongoUserDefinitionId", mongoUserDefinitionId); - tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoUserDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{collectionName}", System.Uri.EscapeDataString(collectionName)); + _url = _url.Replace("{mongoUserDefinitionId}", System.Uri.EscapeDataString(mongoUserDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6806,7 +6652,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6835,12 +6681,6 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(location != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -6863,7 +6703,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -6898,7 +6738,7 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6906,13 +6746,728 @@ internal MongoDbResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the MongoDB databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoDBDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBDatabasesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoDBCollectionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoDBCollectionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoUserDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoUserDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperationsExtensions.cs index 0e26f011fda3..7fccffa62bcd 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoDBResourcesOperationsExtensions.cs @@ -25,7 +25,7 @@ public static partial class MongoDbResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListMongoDBDatabases(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListMongoDBDatabases(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) { return ((IMongoDbResourcesOperations)operations).ListMongoDBDatabasesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -46,7 +46,7 @@ public static System.Collections.Generic.IEnumerable /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMongoDBDatabasesAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMongoDBDatabasesAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMongoDBDatabasesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -191,8 +191,8 @@ public static MongoDbResourcesDeleteMongoDbdatabaseHeaders DeleteMongoDBDatabase } } /// - /// Gets the RUs per second of the MongoDB database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -206,14 +206,14 @@ public static MongoDbResourcesDeleteMongoDbdatabaseHeaders DeleteMongoDBDatabase /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static Microsoft.Rest.Azure.IPage ListMongoDBCollections(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IMongoDbResourcesOperations)operations).GetMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).ListMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the MongoDB database under an existing Azure - /// Cosmos DB database account with the provided name. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -230,15 +230,16 @@ public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMo /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMongoDBCollectionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMongoDBCollectionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Gets the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -252,13 +253,17 @@ public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMo /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + /// + /// Cosmos DB collection name. + /// + public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).UpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).GetMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Gets the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -272,19 +277,21 @@ public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The operations group for this extension method. @@ -298,14 +305,16 @@ public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB collection name. + /// + public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return ((IMongoDbResourcesOperations)operations).MigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The operations group for this extension method. @@ -319,19 +328,21 @@ public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToAutoscale(thi /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateMongoDBDatabaseToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The operations group for this extension method. @@ -345,14 +356,16 @@ public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToAutoscale(thi /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB collection name. + /// + public static MongoDbResourcesDeleteMongoDbcollectionHeaders DeleteMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).MigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).DeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The operations group for this extension method. @@ -366,19 +379,21 @@ public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToManualThrough /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateMongoDBDatabaseToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Lists the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The operations group for this extension method. @@ -392,14 +407,16 @@ public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToManualThrough /// /// Cosmos DB database name. /// - public static System.Collections.Generic.IEnumerable ListMongoDBCollections(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB collection name. + /// + public static BackupInformation RetrieveContinuousBackupInformation(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location) { - return ((IMongoDbResourcesOperations)operations).ListMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, collectionName, location).GetAwaiter().GetResult(); } /// - /// Lists the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The operations group for this extension method. @@ -413,19 +430,22 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMongoDBCollectionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMongoDBCollectionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the MongoDB collection under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -442,14 +462,14 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB collection name. /// - public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).GetMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).GetMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Gets the MongoDB collection under an existing Azure Cosmos DB database - /// account. + /// Gets the RUs per second of the MongoDB collection under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -469,15 +489,15 @@ public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDbReso /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The operations group for this extension method. @@ -494,13 +514,13 @@ public static MongoDBCollectionGetResults GetMongoDBCollection(this IMongoDbReso /// /// Cosmos DB collection name. /// - public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) + public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).UpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The operations group for this extension method. @@ -520,15 +540,16 @@ public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMo /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -545,13 +566,14 @@ public static MongoDBCollectionGetResults CreateUpdateMongoDBCollection(this IMo /// /// Cosmos DB collection name. /// - public static MongoDbResourcesDeleteMongoDbcollectionHeaders DeleteMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults MigrateMongoDBCollectionToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).DeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).MigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -571,16 +593,16 @@ public static MongoDbResourcesDeleteMongoDbcollectionHeaders DeleteMongoDBCollec /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateMongoDBCollectionToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Gets the RUs per second of the MongoDB collection under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -597,14 +619,14 @@ public static MongoDbResourcesDeleteMongoDbcollectionHeaders DeleteMongoDBCollec /// /// Cosmos DB collection name. /// - public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults MigrateMongoDBCollectionToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).GetMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).MigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the MongoDB collection under an existing Azure - /// Cosmos DB database account with the provided name. + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -624,15 +646,16 @@ public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this I /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateMongoDBCollectionToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Gets the RUs per second of the MongoDB database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -646,16 +669,14 @@ public static ThroughputSettingsGetResults GetMongoDBCollectionThroughput(this I /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static ThroughputSettingsGetResults GetMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IMongoDbResourcesOperations)operations).UpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).GetMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Gets the RUs per second of the MongoDB database under an existing Azure + /// Cosmos DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -669,22 +690,18 @@ public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(thi /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to - /// autoscale + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The operations group for this extension method. @@ -698,17 +715,13 @@ public static ThroughputSettingsGetResults UpdateMongoDBCollectionThroughput(thi /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - public static ThroughputSettingsGetResults MigrateMongoDBCollectionToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults UpdateMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IMongoDbResourcesOperations)operations).MigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).UpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to - /// autoscale + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The operations group for this extension method. @@ -722,22 +735,19 @@ public static ThroughputSettingsGetResults MigrateMongoDBCollectionToAutoscale(t /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateMongoDBCollectionToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -751,17 +761,14 @@ public static ThroughputSettingsGetResults MigrateMongoDBCollectionToAutoscale(t /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - public static ThroughputSettingsGetResults MigrateMongoDBCollectionToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IMongoDbResourcesOperations)operations).MigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).MigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -775,95 +782,86 @@ public static ThroughputSettingsGetResults MigrateMongoDBCollectionToManualThrou /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateMongoDBCollectionToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateMongoDBDatabaseToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role - /// Definition with the given Id. + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoRoleDefinitionGetResults GetMongoRoleDefinition(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults MigrateMongoDBDatabaseToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IMongoDbResourcesOperations)operations).GetMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).MigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role - /// Definition with the given Id. + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateMongoDBDatabaseToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB Mongo Role Definition. + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoRoleDefinitionGetResults CreateUpdateMongoRoleDefinition(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) + public static Microsoft.Rest.Azure.IPage ListMongoRoleDefinitions(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) { - return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).ListMongoRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB Mongo Role Definition. + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -873,57 +871,62 @@ public static MongoRoleDefinitionGetResults CreateUpdateMongoRoleDefinition(this /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMongoRoleDefinitionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMongoRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Mongo Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role + /// Definition with the given Id. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void DeleteMongoRoleDefinition(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName) + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + public static MongoRoleDefinitionGetResults GetMongoRoleDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId) { - ((IMongoDbResourcesOperations)operations).DeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).GetMongoRoleDefinitionAsync(resourceGroupName, accountName, mongoRoleDefinitionId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Mongo Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo Role + /// Definition with the given Id. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// /// /// The operations group for this extension method. @@ -934,13 +937,16 @@ public static void DeleteMongoRoleDefinition(this IMongoDbResourcesOperations op /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListMongoRoleDefinitions(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + public static MongoRoleDefinitionGetResults CreateUpdateMongoRoleDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { - return ((IMongoDbResourcesOperations)operations).ListMongoRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoRoleDefinitionAsync(resourceGroupName, accountName, mongoRoleDefinitionId, createUpdateMongoRoleDefinitionParameters).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// Creates or updates an Azure Cosmos DB Mongo Role Definition. /// /// /// The operations group for this extension method. @@ -951,92 +957,87 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMongoRoleDefinitionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMongoRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, createUpdateMongoRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo User - /// Definition with the given Id. + /// Deletes an existing Azure Cosmos DB Mongo Role Definition. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoUserDefinitionGetResults GetMongoUserDefinition(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName) + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + public static MongoDbResourcesDeleteMongoRoleDefinitionHeaders DeleteMongoRoleDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId) { - return ((IMongoDbResourcesOperations)operations).GetMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).DeleteMongoRoleDefinitionAsync(resourceGroupName, accountName, mongoRoleDefinitionId).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB Mongo User - /// Definition with the given Id. + /// Deletes an existing Azure Cosmos DB Mongo Role Definition. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Creates or updates an Azure Cosmos DB Mongo User Definition. + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoUserDefinitionGetResults CreateUpdateMongoUserDefinition(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) + public static Microsoft.Rest.Azure.IPage ListMongoUserDefinitions(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) { - return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).ListMongoUserDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB Mongo User Definition. + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -1046,57 +1047,62 @@ public static MongoUserDefinitionGetResults CreateUpdateMongoUserDefinition(this /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMongoUserDefinitionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMongoUserDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Mongo User Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo User + /// Definition with the given Id. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void DeleteMongoUserDefinition(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName) + /// + /// The ID for the User Definition {dbName.userName}. + /// + public static MongoUserDefinitionGetResults GetMongoUserDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId) { - ((IMongoDbResourcesOperations)operations).DeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).GetMongoUserDefinitionAsync(resourceGroupName, accountName, mongoUserDefinitionId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Mongo User Definition. + /// Retrieves the properties of an existing Azure Cosmos DB Mongo User + /// Definition with the given Id. /// /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.GetMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. @@ -1107,13 +1113,16 @@ public static void DeleteMongoUserDefinition(this IMongoDbResourcesOperations op /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListMongoUserDefinitions(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName) + /// + /// The ID for the User Definition {dbName.userName}. + /// + public static MongoUserDefinitionGetResults CreateUpdateMongoUserDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - return ((IMongoDbResourcesOperations)operations).ListMongoUserDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).CreateUpdateMongoUserDefinitionAsync(resourceGroupName, accountName, mongoUserDefinitionId, createUpdateMongoUserDefinitionParameters).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// Creates or updates an Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. @@ -1124,18 +1133,21 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMongoUserDefinitionsAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListMongoUserDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, createUpdateMongoUserDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Deletes an existing Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. @@ -1146,19 +1158,16 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB collection name. + /// + /// The ID for the User Definition {dbName.userName}. /// - public static BackupInformation RetrieveContinuousBackupInformation(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location) + public static MongoDbResourcesDeleteMongoUserDefinitionHeaders DeleteMongoUserDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId) { - return ((IMongoDbResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, collectionName, location).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).DeleteMongoUserDefinitionAsync(resourceGroupName, accountName, mongoUserDefinitionId).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Deletes an existing Azure Cosmos DB Mongo User Definition. /// /// /// The operations group for this extension method. @@ -1169,20 +1178,17 @@ public static BackupInformation RetrieveContinuousBackupInformation(this IMongoD /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB collection name. + /// + /// The ID for the User Definition {dbName.userName}. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// @@ -1276,7 +1282,7 @@ public static MongoDbResourcesDeleteMongoDbdatabaseHeaders BeginDeleteMongoDBDat } } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The operations group for this extension method. @@ -1290,13 +1296,16 @@ public static MongoDbResourcesDeleteMongoDbdatabaseHeaders BeginDeleteMongoDBDat /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + /// + /// Cosmos DB collection name. + /// + public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return ((IMongoDbResourcesOperations)operations).BeginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// Create or update an Azure Cosmos DB MongoDB Collection /// /// /// The operations group for this extension method. @@ -1310,19 +1319,21 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput( /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The operations group for this extension method. @@ -1336,14 +1347,16 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput( /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB collection name. + /// + public static MongoDbResourcesDeleteMongoDbcollectionHeaders BeginDeleteMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB MongoDB Collection. /// /// /// The operations group for this extension method. @@ -1357,19 +1370,21 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToAutoscal /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateMongoDBDatabaseToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The operations group for this extension method. @@ -1383,14 +1398,16 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToAutoscal /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB collection name. + /// + public static BackupInformation BeginRetrieveContinuousBackupInformation(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location) { - return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, collectionName, location).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a Mongodb collection. /// /// /// The operations group for this extension method. @@ -1404,18 +1421,21 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToManualTh /// /// Cosmos DB database name. /// + /// + /// Cosmos DB collection name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateMongoDBDatabaseToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The operations group for this extension method. @@ -1432,13 +1452,13 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToManualTh /// /// Cosmos DB collection name. /// - public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) + public static ThroughputSettingsGetResults BeginUpdateMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB MongoDB Collection + /// Update the RUs per second of an Azure Cosmos DB MongoDB collection /// /// /// The operations group for this extension method. @@ -1458,15 +1478,16 @@ public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(thi /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -1483,13 +1504,14 @@ public static MongoDBCollectionGetResults BeginCreateUpdateMongoDBCollection(thi /// /// Cosmos DB collection name. /// - public static MongoDbResourcesDeleteMongoDbcollectionHeaders BeginDeleteMongoDBCollection(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).BeginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB MongoDB Collection. + /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -1509,15 +1531,16 @@ public static MongoDbResourcesDeleteMongoDbcollectionHeaders BeginDeleteMongoDBC /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteMongoDBCollectionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateMongoDBCollectionToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteMongoDBCollectionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1534,13 +1557,14 @@ public static MongoDbResourcesDeleteMongoDbcollectionHeaders BeginDeleteMongoDBC /// /// Cosmos DB collection name. /// - public static ThroughputSettingsGetResults BeginUpdateMongoDBCollectionThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) { - return ((IMongoDbResourcesOperations)operations).BeginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); } /// - /// Update the RUs per second of an Azure Cosmos DB MongoDB collection + /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1560,16 +1584,15 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBCollectionThroughpu /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateMongoDBCollectionThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateMongoDBCollectionToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateMongoDBCollectionThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to - /// autoscale + /// Update RUs per second of the an Azure Cosmos DB MongoDB database /// /// /// The operations group for this extension method. @@ -1583,16 +1606,38 @@ public static ThroughputSettingsGetResults BeginUpdateMongoDBCollectionThroughpu /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults BeginUpdateMongoDBDatabaseThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from manual throughput to + /// Update RUs per second of the an Azure Cosmos DB MongoDB database + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateMongoDBDatabaseThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginUpdateMongoDBDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to /// autoscale /// /// @@ -1607,21 +1652,39 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToAutosc /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. + public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToAutoscale(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + { + return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + } + + /// + /// Migrate an Azure Cosmos DB MongoDB database from manual throughput to + /// autoscale + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateMongoDBCollectionToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateMongoDBDatabaseToAutoscaleAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateMongoDBCollectionToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateMongoDBDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// @@ -1636,16 +1699,13 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToAutosc /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// - public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName) + public static ThroughputSettingsGetResults BeginMigrateMongoDBDatabaseToManualThroughput(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, collectionName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual + /// Migrate an Azure Cosmos DB MongoDB database from autoscale to manual /// throughput /// /// @@ -1660,15 +1720,12 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToManual /// /// Cosmos DB database name. /// - /// - /// Cosmos DB collection name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateMongoDBCollectionToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateMongoDBDatabaseToManualThroughputAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateMongoDBCollectionToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateMongoDBDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1679,18 +1736,18 @@ public static ThroughputSettingsGetResults BeginMigrateMongoDBCollectionToManual /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoRoleDefinitionGetResults BeginCreateUpdateMongoRoleDefinition(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + public static MongoRoleDefinitionGetResults BeginCreateUpdateMongoRoleDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { - return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoRoleDefinitionAsync(resourceGroupName, accountName, mongoRoleDefinitionId, createUpdateMongoRoleDefinitionParameters).GetAwaiter().GetResult(); } /// @@ -1699,21 +1756,21 @@ public static MongoRoleDefinitionGetResults BeginCreateUpdateMongoRoleDefinition /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, createUpdateMongoRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1724,18 +1781,18 @@ public static MongoRoleDefinitionGetResults BeginCreateUpdateMongoRoleDefinition /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void BeginDeleteMongoRoleDefinition(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName) + /// + /// The ID for the Role Definition {dbName.roleName}. + /// + public static MongoDbResourcesDeleteMongoRoleDefinitionHeaders BeginDeleteMongoRoleDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId) { - ((IMongoDbResourcesOperations)operations).BeginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginDeleteMongoRoleDefinitionAsync(resourceGroupName, accountName, mongoRoleDefinitionId).GetAwaiter().GetResult(); } /// @@ -1744,21 +1801,24 @@ public static void BeginDeleteMongoRoleDefinition(this IMongoDbResourcesOperatio /// /// The operations group for this extension method. /// - /// - /// The ID for the Role Definition {dbName.roleName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the Role Definition {dbName.roleName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoRoleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteMongoRoleDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoRoleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(mongoRoleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteMongoRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoRoleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Creates or updates an Azure Cosmos DB Mongo User Definition. @@ -1766,18 +1826,18 @@ public static void BeginDeleteMongoRoleDefinition(this IMongoDbResourcesOperatio /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static MongoUserDefinitionGetResults BeginCreateUpdateMongoUserDefinition(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) + /// + /// The ID for the User Definition {dbName.userName}. + /// + public static MongoUserDefinitionGetResults BeginCreateUpdateMongoUserDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginCreateUpdateMongoUserDefinitionAsync(resourceGroupName, accountName, mongoUserDefinitionId, createUpdateMongoUserDefinitionParameters).GetAwaiter().GetResult(); } /// @@ -1786,21 +1846,21 @@ public static MongoUserDefinitionGetResults BeginCreateUpdateMongoUserDefinition /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, createUpdateMongoUserDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1811,18 +1871,18 @@ public static MongoUserDefinitionGetResults BeginCreateUpdateMongoUserDefinition /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void BeginDeleteMongoUserDefinition(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName) + /// + /// The ID for the User Definition {dbName.userName}. + /// + public static MongoDbResourcesDeleteMongoUserDefinitionHeaders BeginDeleteMongoUserDefinition(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId) { - ((IMongoDbResourcesOperations)operations).BeginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((IMongoDbResourcesOperations)operations).BeginDeleteMongoUserDefinitionAsync(resourceGroupName, accountName, mongoUserDefinitionId).GetAwaiter().GetResult(); } /// @@ -1831,69 +1891,157 @@ public static void BeginDeleteMongoUserDefinition(this IMongoDbResourcesOperatio /// /// The operations group for this extension method. /// - /// - /// The ID for the User Definition {dbName.userName}. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The ID for the User Definition {dbName.userName}. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string mongoUserDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteMongoUserDefinitionAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string mongoUserDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(mongoUserDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteMongoUserDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, mongoUserDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Lists the MongoDB databases under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + public static Microsoft.Rest.Azure.IPage ListMongoDBDatabasesNext(this IMongoDbResourcesOperations operations, string nextPageLink) + { + return ((IMongoDbResourcesOperations)operations).ListMongoDBDatabasesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the MongoDB databases under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. /// - /// - /// Cosmos DB database name. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB collection name. + /// + /// The cancellation token. /// - public static BackupInformation BeginRetrieveContinuousBackupInformation(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location) + public static async System.Threading.Tasks.Task> ListMongoDBDatabasesNextAsync(this IMongoDbResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - return ((IMongoDbResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, collectionName, location).GetAwaiter().GetResult(); + using (var _result = await operations.ListMongoDBDatabasesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMongoDBCollectionsNext(this IMongoDbResourcesOperations operations, string nextPageLink) + { + return ((IMongoDbResourcesOperations)operations).ListMongoDBCollectionsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a Mongodb collection. + /// Lists the MongoDB collection under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Cosmos DB database account name. + /// + /// The cancellation token. /// - /// - /// Cosmos DB database name. + public static async System.Threading.Tasks.Task> ListMongoDBCollectionsNextAsync(this IMongoDbResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoDBCollectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// The operations group for this extension method. /// - /// - /// Cosmos DB collection name. + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMongoRoleDefinitionsNext(this IMongoDbResourcesOperations operations, string nextPageLink) + { + return ((IMongoDbResourcesOperations)operations).ListMongoRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this IMongoDbResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string collectionName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMongoRoleDefinitionsNextAsync(this IMongoDbResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, collectionName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListMongoRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMongoUserDefinitionsNext(this IMongoDbResourcesOperations operations, string nextPageLink) + { + return ((IMongoDbResourcesOperations)operations).ListMongoUserDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Mongo User Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMongoUserDefinitionsNextAsync(this IMongoDbResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoUserDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperations.cs new file mode 100644 index 000000000000..bc858a2a81a2 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperations.cs @@ -0,0 +1,2428 @@ +// 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 System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// MongoMiResourcesOperations operations. + /// + internal partial class MongoMiResourcesOperations : Microsoft.Rest.IServiceOperations, IMongoMiResourcesOperations + { + /// + /// Initializes a new instance of the MongoMiResourcesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal MongoMiResourcesOperations (CosmosDBManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the CosmosDBManagementClient + /// + public CosmosDBManagementClient Client { get; private set; } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoMIRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoMIRoleAssignments", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Assignment with the given Id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> GetMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoMIRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoMIRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoMIRoleDefinitions", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Definition with the given Id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> GetMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetMongoMIRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateMongoMIRoleAssignmentParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoMIRoleAssignmentParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + tracingParameters.Add("createUpdateMongoMIRoleAssignmentParameters", createUpdateMongoMIRoleAssignmentParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoMIRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateMongoMIRoleAssignmentParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoMIRoleAssignmentParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteMongoMIRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoMIRoleAssignment", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (createUpdateMongoMIRoleDefinitionParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateMongoMIRoleDefinitionParameters"); + } + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + tracingParameters.Add("createUpdateMongoMIRoleDefinitionParameters", createUpdateMongoMIRoleDefinitionParameters); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateMongoMIRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(createUpdateMongoMIRoleDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateMongoMIRoleDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginDeleteMongoMIRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (accountName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteMongoMIRoleDefinition", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200 && (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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoMIRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoMIRoleAssignmentsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMongoMIRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMongoMIRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperationsExtensions.cs new file mode 100644 index 000000000000..a5694910b6c4 --- /dev/null +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/MongoMIResourcesOperationsExtensions.cs @@ -0,0 +1,614 @@ +// 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.Azure; + using Models; + + /// + /// Extension methods for MongoMiResourcesOperations + /// + public static partial class MongoMiResourcesOperationsExtensions + { + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// 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 Microsoft.Rest.Azure.IPage ListMongoMIRoleAssignments(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((IMongoMiResourcesOperations)operations).ListMongoMIRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// 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 System.Threading.Tasks.Task> ListMongoMIRoleAssignmentsAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoMIRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Assignment with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static MongoMIRoleAssignmentResource GetMongoMIRoleAssignment(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((IMongoMiResourcesOperations)operations).GetMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Assignment with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetMongoMIRoleAssignmentAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static MongoMIRoleAssignmentResource CreateUpdateMongoMIRoleAssignment(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters) + { + return ((IMongoMiResourcesOperations)operations).CreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateUpdateMongoMIRoleAssignmentAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static MongoMiResourcesDeleteMongoMiroleAssignmentHeaders DeleteMongoMIRoleAssignment(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((IMongoMiResourcesOperations)operations).DeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteMongoMIRoleAssignmentAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// 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 Microsoft.Rest.Azure.IPage ListMongoMIRoleDefinitions(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((IMongoMiResourcesOperations)operations).ListMongoMIRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// 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 System.Threading.Tasks.Task> ListMongoMIRoleDefinitionsAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoMIRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static MongoMIRoleDefinitionResource GetMongoMIRoleDefinition(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IMongoMiResourcesOperations)operations).GetMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB MongoMI Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetMongoMIRoleDefinitionAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static MongoMIRoleDefinitionResource CreateUpdateMongoMIRoleDefinition(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters) + { + return ((IMongoMiResourcesOperations)operations).CreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateUpdateMongoMIRoleDefinitionAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static MongoMiResourcesDeleteMongoMiroleDefinitionHeaders DeleteMongoMIRoleDefinition(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IMongoMiResourcesOperations)operations).DeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteMongoMIRoleDefinitionAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static MongoMIRoleAssignmentResource BeginCreateUpdateMongoMIRoleAssignment(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters) + { + return ((IMongoMiResourcesOperations)operations).BeginCreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateMongoMIRoleAssignmentAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, MongoMIRoleAssignmentResource createUpdateMongoMIRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + public static MongoMiResourcesDeleteMongoMiroleAssignmentHeaders BeginDeleteMongoMIRoleAssignment(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + { + return ((IMongoMiResourcesOperations)operations).BeginDeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteMongoMIRoleAssignmentAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteMongoMIRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static MongoMIRoleDefinitionResource BeginCreateUpdateMongoMIRoleDefinition(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters) + { + return ((IMongoMiResourcesOperations)operations).BeginCreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateMongoMIRoleDefinitionAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, MongoMIRoleDefinitionResource createUpdateMongoMIRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static MongoMiResourcesDeleteMongoMiroleDefinitionHeaders BeginDeleteMongoMIRoleDefinition(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((IMongoMiResourcesOperations)operations).BeginDeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB MongoMI Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteMongoMIRoleDefinitionAsync(this IMongoMiResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteMongoMIRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMongoMIRoleAssignmentsNext(this IMongoMiResourcesOperations operations, string nextPageLink) + { + return ((IMongoMiResourcesOperations)operations).ListMongoMIRoleAssignmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMongoMIRoleAssignmentsNextAsync(this IMongoMiResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoMIRoleAssignmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMongoMIRoleDefinitionsNext(this IMongoMiResourcesOperations operations, string nextPageLink) + { + return ((IMongoMiResourcesOperations)operations).ListMongoMIRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMongoMIRoleDefinitionsNextAsync(this IMongoMiResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMongoMIRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperations.cs index c634ed47f7cf..26b772b8bf5e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperations.cs @@ -68,23 +68,18 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,7 +122,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); @@ -139,14 +132,14 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -236,7 +229,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -309,17 +302,12 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) string notebookWorkspaceName = "default"; - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -355,7 +343,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -364,7 +351,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -376,15 +362,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -529,10 +515,10 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, notebookCreateUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, notebookCreateUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -551,10 +537,10 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -594,17 +580,12 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) string notebookWorkspaceName = "default"; - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -640,7 +621,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -649,7 +629,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -661,15 +640,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -811,10 +790,10 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -833,10 +812,10 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> StartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -873,7 +852,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -884,17 +863,12 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "notebookCreateUpdateParameters"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -930,7 +904,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -939,7 +912,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -952,15 +924,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1056,7 +1028,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1082,6 +1054,19 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1120,23 +1105,18 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { string notebookWorkspaceName = "default"; - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1172,7 +1152,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1181,7 +1160,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -1193,15 +1171,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1291,7 +1269,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1299,6 +1277,19 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1337,23 +1328,18 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { string notebookWorkspaceName = "default"; - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1389,7 +1375,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1398,7 +1383,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -1410,15 +1394,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1508,7 +1492,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1516,6 +1500,19 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1554,23 +1551,18 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { string notebookWorkspaceName = "default"; - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1606,7 +1598,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1615,7 +1606,6 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); @@ -1627,15 +1617,15 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1725,7 +1715,7 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1733,6 +1723,196 @@ internal NotebookWorkspacesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperationsExtensions.cs index d71680e1387b..b9fcb5c069a8 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/NotebookWorkspacesOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class NotebookWorkspacesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListByDatabaseAccount(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccount(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { return ((INotebookWorkspacesOperations)operations).ListByDatabaseAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable ListByDa /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByDatabaseAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -141,9 +141,9 @@ public static NotebookWorkspace CreateOrUpdate(this INotebookWorkspacesOperation /// /// Cosmos DB database account name. /// - public static void Delete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesDeleteHeaders Delete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -161,9 +161,12 @@ public static void Delete(this INotebookWorkspacesOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Retrieves the connection info for the notebook workspace @@ -216,9 +219,9 @@ public static NotebookWorkspaceConnectionInfoResult ListConnectionInfo(this INot /// /// Cosmos DB database account name. /// - public static void RegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesRegenerateAuthTokenHeaders RegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).RegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).RegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -236,9 +239,12 @@ public static void RegenerateAuthToken(this INotebookWorkspacesOperations operat /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.RegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.RegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Starts the notebook workspace @@ -252,9 +258,9 @@ public static void RegenerateAuthToken(this INotebookWorkspacesOperations operat /// /// Cosmos DB database account name. /// - public static void Start(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesStartHeaders Start(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).StartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).StartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -272,9 +278,12 @@ public static void Start(this INotebookWorkspacesOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task StartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task StartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.StartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.StartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Creates the notebook workspace for a Cosmos DB account. @@ -327,9 +336,9 @@ public static NotebookWorkspace BeginCreateOrUpdate(this INotebookWorkspacesOper /// /// Cosmos DB database account name. /// - public static void BeginDelete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesDeleteHeaders BeginDelete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -347,9 +356,12 @@ public static void BeginDelete(this INotebookWorkspacesOperations operations, st /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Regenerates the auth token for the notebook workspace @@ -363,9 +375,9 @@ public static void BeginDelete(this INotebookWorkspacesOperations operations, st /// /// Cosmos DB database account name. /// - public static void BeginRegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesRegenerateAuthTokenHeaders BeginRegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).BeginRegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).BeginRegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -383,9 +395,12 @@ public static void BeginRegenerateAuthToken(this INotebookWorkspacesOperations o /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Starts the notebook workspace @@ -399,9 +414,9 @@ public static void BeginRegenerateAuthToken(this INotebookWorkspacesOperations o /// /// Cosmos DB database account name. /// - public static void BeginStart(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + public static NotebookWorkspacesStartHeaders BeginStart(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) { - ((INotebookWorkspacesOperations)operations).BeginStartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((INotebookWorkspacesOperations)operations).BeginStartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -419,9 +434,45 @@ public static void BeginStart(this INotebookWorkspacesOperations operations, str /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginStartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginStartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccountNext(this INotebookWorkspacesOperations operations, string nextPageLink) + { + return ((INotebookWorkspacesOperations)operations).ListByDatabaseAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByDatabaseAccountNextAsync(this INotebookWorkspacesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByDatabaseAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Operations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Operations.cs index 44ccc3525224..b58719a07fc5 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Operations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/Operations.cs @@ -68,7 +68,11 @@ internal Operations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -76,7 +80,6 @@ internal Operations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -88,9 +91,9 @@ internal Operations (CosmosDBManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DocumentDB/operations").ToString(); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -152,14 +155,13 @@ internal Operations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -169,10 +171,6 @@ internal Operations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -199,7 +197,7 @@ internal Operations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -334,14 +332,13 @@ internal Operations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -351,10 +348,6 @@ internal Operations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -381,7 +374,7 @@ internal Operations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperations.cs index f6fe98078a92..23a80c850c5b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperations.cs @@ -84,23 +84,18 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -155,7 +150,6 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -168,7 +162,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); @@ -179,7 +172,7 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseRid}", System.Uri.EscapeDataString(databaseRid)); @@ -187,9 +180,9 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) _url = _url.Replace("{partitionKeyRangeId}", System.Uri.EscapeDataString(partitionKeyRangeId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -255,14 +248,13 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -272,10 +264,184 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -288,7 +454,7 @@ internal PartitionKeyRangeIdOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperationsExtensions.cs index 6da36250d212..b76551a394a8 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdOperationsExtensions.cs @@ -40,7 +40,7 @@ public static partial class PartitionKeyRangeIdOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IPartitionKeyRangeIdOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IPartitionKeyRangeIdOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter) { return ((IPartitionKeyRangeIdOperations)operations).ListMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter).GetAwaiter().GetResult(); } @@ -76,12 +76,47 @@ public static System.Collections.Generic.IEnumerable ListMetric /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPartitionKeyRangeIdOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPartitionKeyRangeIdOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IPartitionKeyRangeIdOperations operations, string nextPageLink) + { + return ((IPartitionKeyRangeIdOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IPartitionKeyRangeIdOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperations.cs index 399eaee2fad5..62d96c8b8d9c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperations.cs @@ -87,23 +87,18 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -163,7 +158,6 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -177,7 +171,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); @@ -188,7 +181,7 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{region}", System.Uri.EscapeDataString(region)); @@ -197,9 +190,9 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) _url = _url.Replace("{partitionKeyRangeId}", System.Uri.EscapeDataString(partitionKeyRangeId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -265,14 +258,13 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -282,10 +274,184 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id and region. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -298,7 +464,7 @@ internal PartitionKeyRangeIdRegionOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs index 1706779d452d..03893ef19f65 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PartitionKeyRangeIdRegionOperationsExtensions.cs @@ -43,7 +43,7 @@ public static partial class PartitionKeyRangeIdRegionOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IPartitionKeyRangeIdRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IPartitionKeyRangeIdRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter) { return ((IPartitionKeyRangeIdRegionOperations)operations).ListMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter).GetAwaiter().GetResult(); } @@ -82,12 +82,47 @@ public static System.Collections.Generic.IEnumerable ListMetric /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPartitionKeyRangeIdRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPartitionKeyRangeIdRegionOperations operations, string resourceGroupName, string accountName, string region, string databaseRid, string collectionRid, string partitionKeyRangeId, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IPartitionKeyRangeIdRegionOperations operations, string nextPageLink) + { + return ((IPartitionKeyRangeIdRegionOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given + /// partition key range id and region. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IPartitionKeyRangeIdRegionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperations.cs index da4a89280795..8dc59d0490b4 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperations.cs @@ -75,23 +75,18 @@ internal PercentileOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -131,7 +126,6 @@ internal PercentileOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -141,7 +135,6 @@ internal PercentileOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("filter", filter); @@ -152,14 +145,14 @@ internal PercentileOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -225,14 +218,13 @@ internal PercentileOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -242,10 +234,184 @@ internal PercentileOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. This url is only for PBS and Replication Latency data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -258,7 +424,7 @@ internal PercentileOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperationsExtensions.cs index bb1069061828..5f2b4c648703 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileOperationsExtensions.cs @@ -31,7 +31,7 @@ public static partial class PercentileOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IPercentileOperations operations, string resourceGroupName, string accountName, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IPercentileOperations operations, string resourceGroupName, string accountName, string filter) { return ((IPercentileOperations)operations).ListMetricsAsync(resourceGroupName, accountName, filter).GetAwaiter().GetResult(); } @@ -58,12 +58,47 @@ public static System.Collections.Generic.IEnumerable ListMetri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileOperations operations, string resourceGroupName, string accountName, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileOperations operations, string resourceGroupName, string accountName, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. This url is only for PBS and Replication Latency data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IPercentileOperations operations, string nextPageLink) + { + return ((IPercentileOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given database + /// account. This url is only for PBS and Replication Latency data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IPercentileOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperations.cs index e5741af0765c..632eb433e0ad 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperations.cs @@ -84,23 +84,18 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -150,7 +145,6 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -162,7 +156,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); @@ -173,16 +166,16 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{sourceRegion}", System.Uri.EscapeDataString(sourceRegion)); _url = _url.Replace("{targetRegion}", System.Uri.EscapeDataString(targetRegion)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -248,14 +241,13 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -265,10 +257,185 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given account, + /// source and target region. This url is only for PBS and Replication Latency + /// data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpRequest.Headers.Remove("accept-language"); } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -281,7 +448,7 @@ internal PercentileSourceTargetOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperationsExtensions.cs index df81641c614d..0998af0e02d8 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileSourceTargetOperationsExtensions.cs @@ -40,7 +40,7 @@ public static partial class PercentileSourceTargetOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IPercentileSourceTargetOperations operations, string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IPercentileSourceTargetOperations operations, string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter) { return ((IPercentileSourceTargetOperations)operations).ListMetricsAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter).GetAwaiter().GetResult(); } @@ -76,12 +76,49 @@ public static System.Collections.Generic.IEnumerable ListMetri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileSourceTargetOperations operations, string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileSourceTargetOperations operations, string resourceGroupName, string accountName, string sourceRegion, string targetRegion, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given account, + /// source and target region. This url is only for PBS and Replication Latency + /// data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IPercentileSourceTargetOperations operations, string nextPageLink) + { + return ((IPercentileSourceTargetOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given account, + /// source and target region. This url is only for PBS and Replication Latency + /// data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IPercentileSourceTargetOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperations.cs index af71d3904471..ddb45e48b323 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperations.cs @@ -79,23 +79,18 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListMetricsWithHttpMessagesAsync(string resourceGroupName, string accountName, string targetRegion, string filter, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -140,7 +135,6 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "filter"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,7 +145,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); @@ -162,15 +155,15 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{targetRegion}", System.Uri.EscapeDataString(targetRegion)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (filter != null) { @@ -236,14 +229,13 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -253,10 +245,184 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the metrics determined by the given filter for the given account + /// target region. This url is only for PBS and Replication Latency data + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListMetricsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListMetricsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -269,7 +435,7 @@ internal PercentileTargetOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperationsExtensions.cs index c34dd6218ecc..9537ce9aca9c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PercentileTargetOperationsExtensions.cs @@ -35,7 +35,7 @@ public static partial class PercentileTargetOperationsExtensions /// have an or of multiple names), startTime, endTime, and timeGrain. The /// supported operator is eq. /// - public static System.Collections.Generic.IEnumerable ListMetrics(this IPercentileTargetOperations operations, string resourceGroupName, string accountName, string targetRegion, string filter) + public static Microsoft.Rest.Azure.IPage ListMetrics(this IPercentileTargetOperations operations, string resourceGroupName, string accountName, string targetRegion, string filter) { return ((IPercentileTargetOperations)operations).ListMetricsAsync(resourceGroupName, accountName, targetRegion, filter).GetAwaiter().GetResult(); } @@ -66,12 +66,47 @@ public static System.Collections.Generic.IEnumerable ListMetri /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileTargetOperations operations, string resourceGroupName, string accountName, string targetRegion, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListMetricsAsync(this IPercentileTargetOperations operations, string resourceGroupName, string accountName, string targetRegion, string filter, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, targetRegion, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Retrieves the metrics determined by the given filter for the given account + /// target region. This url is only for PBS and Replication Latency data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListMetricsNext(this IPercentileTargetOperations operations, string nextPageLink) + { + return ((IPercentileTargetOperations)operations).ListMetricsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the metrics determined by the given filter for the given account + /// target region. This url is only for PBS and Replication Latency data + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListMetricsNextAsync(this IPercentileTargetOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListMetricsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperations.cs index 9e75448fe235..88e7e8340257 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperations.cs @@ -68,23 +68,18 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,7 +122,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); @@ -139,14 +132,14 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -208,14 +201,13 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +217,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -241,7 +229,7 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -317,17 +305,12 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -367,7 +350,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -376,7 +358,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -388,15 +369,15 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -458,14 +439,13 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -475,10 +455,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -549,10 +525,10 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -574,10 +550,10 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -617,7 +593,7 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, PrivateEndpointConnection parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -628,17 +604,12 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -678,7 +649,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -687,7 +657,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -700,15 +669,15 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -776,11 +745,11 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -804,7 +773,7 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -830,6 +799,19 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -871,23 +853,18 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -927,7 +904,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -936,7 +912,6 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -948,15 +923,15 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1018,11 +993,11 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1046,7 +1021,7 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1054,6 +1029,196 @@ internal PrivateEndpointConnectionsOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List all private endpoint connections on a Cosmos DB account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperationsExtensions.cs index 0f95ded8b0c1..a2f69012b73e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateEndpointConnectionsOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class PrivateEndpointConnectionsOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListByDatabaseAccount(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccount(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName) { return ((IPrivateEndpointConnectionsOperations)operations).ListByDatabaseAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByDatabaseAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -156,9 +156,9 @@ public static PrivateEndpointConnection CreateOrUpdate(this IPrivateEndpointConn /// /// The name of the private endpoint connection. /// - public static void Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) + public static PrivateEndpointConnectionsDeleteHeaders Delete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) { - ((IPrivateEndpointConnectionsOperations)operations).DeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionsOperations)operations).DeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -179,9 +179,12 @@ public static void Delete(this IPrivateEndpointConnectionsOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Approve or reject a private endpoint connection with a given name. @@ -243,9 +246,9 @@ public static PrivateEndpointConnection BeginCreateOrUpdate(this IPrivateEndpoin /// /// The name of the private endpoint connection. /// - public static void BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) + public static PrivateEndpointConnectionsDeleteHeaders BeginDelete(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName) { - ((IPrivateEndpointConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionsOperations)operations).BeginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -266,9 +269,45 @@ public static void BeginDelete(this IPrivateEndpointConnectionsOperations operat /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateEndpointConnectionsOperations operations, string resourceGroupName, string accountName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// List all private endpoint connections on a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccountNext(this IPrivateEndpointConnectionsOperations operations, string nextPageLink) + { + return ((IPrivateEndpointConnectionsOperations)operations).ListByDatabaseAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all private endpoint connections on a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByDatabaseAccountNextAsync(this IPrivateEndpointConnectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByDatabaseAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs index 24f1d4a4cfcb..3c9c502b6309 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperations.cs @@ -69,23 +69,18 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -120,7 +115,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +123,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); @@ -140,14 +133,14 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -209,14 +202,13 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +218,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -242,7 +230,7 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -319,17 +307,12 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -369,7 +352,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -378,7 +360,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("accountName", accountName); tracingParameters.Add("groupName", groupName); @@ -390,15 +371,15 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -460,14 +441,13 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -477,10 +457,6 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -529,6 +505,184 @@ internal PrivateLinkResourcesOperations (CosmosDBManagementClient client) + } + /// + /// Gets the private link resources that need to be created for a Cosmos DB + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListByDatabaseAccountNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseAccountNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperationsExtensions.cs index da0fc2a320c0..3534f1e3261a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/PrivateLinkResourcesOperationsExtensions.cs @@ -25,7 +25,7 @@ public static partial class PrivateLinkResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListByDatabaseAccount(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccount(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName) { return ((IPrivateLinkResourcesOperations)operations).ListByDatabaseAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -46,7 +46,7 @@ public static System.Collections.Generic.IEnumerable ListBy /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByDatabaseAccountAsync(this IPrivateLinkResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByDatabaseAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -100,5 +100,40 @@ public static PrivateLinkResource Get(this IPrivateLinkResourcesOperations opera return _result.Body; } } + /// + /// Gets the private link resources that need to be created for a Cosmos DB + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByDatabaseAccountNext(this IPrivateLinkResourcesOperations operations, string nextPageLink) + { + return ((IPrivateLinkResourcesOperations)operations).ListByDatabaseAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the private link resources that need to be created for a Cosmos DB + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByDatabaseAccountNextAsync(this IPrivateLinkResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByDatabaseAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperations.cs index 7aee827ded80..cbd1353e145d 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperations.cs @@ -68,29 +68,23 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationWithHttpMessagesAsync(string location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -98,7 +92,6 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); @@ -109,13 +102,13 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -210,7 +203,7 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -248,11 +241,17 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Lists all the restorable Azure Cosmos DB database accounts available under - /// the subscription. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// Retrieves the properties of an existing Azure Cosmos DB restorable database + /// account. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' /// permission. /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// + /// The instanceId GUID of a restorable database account. + /// /// /// Headers that will be added to request. /// @@ -274,24 +273,224 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (location == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + } + + if (instanceId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } - if (this.Client.SubscriptionId != null) + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) { - if (this.Client.SubscriptionId.Length < 1) + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("instanceId", instanceId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetByLocation", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + _httpRequest.Headers.Remove("accept-language"); } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - string apiVersion = "2025-10-15"; + + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -299,7 +498,6 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -309,12 +507,12 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -409,7 +607,7 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -447,16 +645,13 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) } /// - /// Retrieves the properties of an existing Azure Cosmos DB restorable database - /// account. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription and in a region. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' /// permission. /// - /// - /// Cosmos DB region, with spaces between words and each word capitalized. - /// - /// - /// The instanceId GUID of a restorable database account. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -479,34 +674,198 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByLocationNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); - - if (this.Client.SubscriptionId == null) + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } - if (this.Client.SubscriptionId != null) + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) { - if (this.Client.SubscriptionId.Length < 1) + if (_httpRequest.Headers.Contains("accept-language")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + _httpRequest.Headers.Remove("accept-language"); } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (location == null) + + if (customHeaders != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + 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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - if (instanceId == null) + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; - string apiVersion = "2025-10-15"; + + + + + } + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,27 +873,17 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("location", location); - tracingParameters.Add("instanceId", instanceId); - + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetByLocation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL - - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.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); @@ -628,7 +977,7 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -642,7 +991,7 @@ internal RestorableDatabaseAccountsOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperationsExtensions.cs index 3b426b0a17eb..c2f23b776407 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableDatabaseAccountsOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class RestorableDatabaseAccountsOperationsExtensions /// /// Cosmos DB region, with spaces between words and each word capitalized. /// - public static System.Collections.Generic.IEnumerable ListByLocation(this IRestorableDatabaseAccountsOperations operations, string location) + public static Microsoft.Rest.Azure.IPage ListByLocation(this IRestorableDatabaseAccountsOperations operations, string location) { return ((IRestorableDatabaseAccountsOperations)operations).ListByLocationAsync(location).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) { @@ -52,6 +52,51 @@ public static System.Collections.Generic.IEnumerable + /// Retrieves the properties of an existing Azure Cosmos DB restorable database + /// account. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// + /// The instanceId GUID of a restorable database account. + /// + public static RestorableDatabaseAccountGetResult GetByLocation(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId) + { + return ((IRestorableDatabaseAccountsOperations)operations).GetByLocationAsync(location, instanceId).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the properties of an existing Azure Cosmos DB restorable database + /// account. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// + /// The instanceId GUID of a restorable database account. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByLocationWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all the restorable Azure Cosmos DB database accounts available under /// the subscription. This call requires /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' @@ -60,7 +105,7 @@ public static System.Collections.Generic.IEnumerable /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableDatabaseAccountsOperations operations) + public static Microsoft.Rest.Azure.IPage List(this IRestorableDatabaseAccountsOperations operations) { return ((IRestorableDatabaseAccountsOperations)operations).ListAsync().GetAwaiter().GetResult(); } @@ -77,7 +122,7 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableDatabaseAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableDatabaseAccountsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -85,46 +130,79 @@ public static System.Collections.Generic.IEnumerable - /// Retrieves the properties of an existing Azure Cosmos DB restorable database - /// account. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription and in a region. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' /// permission. /// /// /// The operations group for this extension method. /// - /// - /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The instanceId GUID of a restorable database account. - /// - public static RestorableDatabaseAccountGetResult GetByLocation(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId) + public static Microsoft.Rest.Azure.IPage ListByLocationNext(this IRestorableDatabaseAccountsOperations operations, string nextPageLink) { - return ((IRestorableDatabaseAccountsOperations)operations).GetByLocationAsync(location, instanceId).GetAwaiter().GetResult(); + return ((IRestorableDatabaseAccountsOperations)operations).ListByLocationNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB restorable database - /// account. This call requires - /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription and in a region. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' /// permission. /// /// /// The operations group for this extension method. /// - /// - /// Cosmos DB region, with spaces between words and each word capitalized. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// The instanceId GUID of a restorable database account. + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByLocationNextAsync(this IRestorableDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByLocationNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableDatabaseAccountsOperations operations, string nextPageLink) + { + return ((IRestorableDatabaseAccountsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the restorable Azure Cosmos DB database accounts available under + /// the subscription. This call requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableDatabaseAccountsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetByLocationWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperations.cs index ae4c1d297004..ee4db3d1634e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperations.cs @@ -73,23 +73,18 @@ internal RestorableGremlinDatabasesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -100,7 +95,6 @@ internal RestorableGremlinDatabasesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -108,7 +102,6 @@ internal RestorableGremlinDatabasesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); @@ -120,15 +113,202 @@ internal RestorableGremlinDatabasesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -222,7 +402,7 @@ internal RestorableGremlinDatabasesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperationsExtensions.cs index 71ec94a7f641..02c74dcbc846 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinDatabasesOperationsExtensions.cs @@ -29,7 +29,7 @@ public static partial class RestorableGremlinDatabasesOperationsExtensions /// /// The instanceId GUID of a restorable database account. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableGremlinDatabasesOperations operations, string location, string instanceId) + public static Microsoft.Rest.Azure.IPage List(this IRestorableGremlinDatabasesOperations operations, string location, string instanceId) { return ((IRestorableGremlinDatabasesOperations)operations).ListAsync(location, instanceId).GetAwaiter().GetResult(); } @@ -54,12 +54,55 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableGremlinDatabasesOperations operations, string nextPageLink) + { + return ((IRestorableGremlinDatabasesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableGremlinDatabasesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperations.cs index 503c29b5057c..b39dc1002a8e 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperations.cs @@ -81,23 +81,18 @@ internal RestorableGremlinGraphsOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -111,7 +106,6 @@ internal RestorableGremlinGraphsOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +113,6 @@ internal RestorableGremlinGraphsOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restorableGremlinDatabaseRid", restorableGremlinDatabaseRid); @@ -134,14 +127,14 @@ internal RestorableGremlinGraphsOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restorableGremlinDatabaseRid != null) { @@ -248,7 +241,193 @@ internal RestorableGremlinGraphsOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin graphs under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperationsExtensions.cs index cab687f31971..1b2f0aeec426 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinGraphsOperationsExtensions.cs @@ -37,7 +37,7 @@ public static partial class RestorableGremlinGraphsOperationsExtensions /// /// Restorable Gremlin graphs event feed end time. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableGremlinGraphsOperations operations, string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableGremlinGraphsOperations operations, string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) { return ((IRestorableGremlinGraphsOperations)operations).ListAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime).GetAwaiter().GetResult(); } @@ -70,12 +70,53 @@ public static partial class RestorableGremlinGraphsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinGraphsOperations operations, string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinGraphsOperations operations, string location, string instanceId, string restorableGremlinDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin graphs under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableGremlinGraphsOperations operations, string nextPageLink) + { + return ((IRestorableGremlinGraphsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Gremlin graphs under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableGremlinGraphsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperations.cs index b27258617813..22d76d5d391c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperations.cs @@ -79,23 +79,18 @@ internal RestorableGremlinResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -108,7 +103,6 @@ internal RestorableGremlinResourcesOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,7 +110,6 @@ internal RestorableGremlinResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restoreLocation", restoreLocation); @@ -130,14 +123,14 @@ internal RestorableGremlinResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restoreLocation != null) { @@ -240,7 +233,194 @@ internal RestorableGremlinResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Return a list of gremlin database and graphs combo that exist on the + /// account at the given timestamp and location. This helps in scenarios to + /// validate what resources exist at given timestamp and location. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperationsExtensions.cs index 7ea7d62475dd..f8c0d99e827a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableGremlinResourcesOperationsExtensions.cs @@ -35,7 +35,7 @@ public static partial class RestorableGremlinResourcesOperationsExtensions /// /// The timestamp when the restorable resources existed. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableGremlinResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableGremlinResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) { return ((IRestorableGremlinResourcesOperations)operations).ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult(); } @@ -66,12 +66,55 @@ public static partial class RestorableGremlinResourcesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableGremlinResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Return a list of gremlin database and graphs combo that exist on the + /// account at the given timestamp and location. This helps in scenarios to + /// validate what resources exist at given timestamp and location. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableGremlinResourcesOperations operations, string nextPageLink) + { + return ((IRestorableGremlinResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Return a list of gremlin database and graphs combo that exist on the + /// account at the given timestamp and location. This helps in scenarios to + /// validate what resources exist at given timestamp and location. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableGremlinResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperations.cs index 6f9c695e1188..e25bd548da11 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperations.cs @@ -81,23 +81,18 @@ internal RestorableMongodbCollectionsOperations (CosmosDBManagementClient client /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -111,7 +106,6 @@ internal RestorableMongodbCollectionsOperations (CosmosDBManagementClient client - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +113,6 @@ internal RestorableMongodbCollectionsOperations (CosmosDBManagementClient client { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restorableMongodbDatabaseRid", restorableMongodbDatabaseRid); @@ -134,14 +127,14 @@ internal RestorableMongodbCollectionsOperations (CosmosDBManagementClient client var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restorableMongodbDatabaseRid != null) { @@ -248,7 +241,193 @@ internal RestorableMongodbCollectionsOperations (CosmosDBManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB collections under a specific database. This helps in scenario + /// where container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperationsExtensions.cs index 4ddbce44c1eb..5f58fb52665c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbCollectionsOperationsExtensions.cs @@ -37,7 +37,7 @@ public static partial class RestorableMongodbCollectionsOperationsExtensions /// /// Restorable MongoDB collections event feed end time. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) { return ((IRestorableMongodbCollectionsOperations)operations).ListAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime).GetAwaiter().GetResult(); } @@ -70,12 +70,53 @@ public static partial class RestorableMongodbCollectionsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB collections under a specific database. This helps in scenario + /// where container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableMongodbCollectionsOperations operations, string nextPageLink) + { + return ((IRestorableMongodbCollectionsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB collections under a specific database. This helps in scenario + /// where container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableMongodbCollectionsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperations.cs index 37e25c20df2c..3f3826d5a2c8 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperations.cs @@ -73,23 +73,18 @@ internal RestorableMongodbDatabasesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -100,7 +95,6 @@ internal RestorableMongodbDatabasesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -108,7 +102,6 @@ internal RestorableMongodbDatabasesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); @@ -120,15 +113,202 @@ internal RestorableMongodbDatabasesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -222,7 +402,7 @@ internal RestorableMongodbDatabasesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperationsExtensions.cs index bced4a5a52e4..741ad0ba9714 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbDatabasesOperationsExtensions.cs @@ -29,7 +29,7 @@ public static partial class RestorableMongodbDatabasesOperationsExtensions /// /// The instanceId GUID of a restorable database account. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId) + public static Microsoft.Rest.Azure.IPage List(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId) { return ((IRestorableMongodbDatabasesOperations)operations).ListAsync(location, instanceId).GetAwaiter().GetResult(); } @@ -54,12 +54,55 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableMongodbDatabasesOperations operations, string nextPageLink) + { + return ((IRestorableMongodbDatabasesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// MongoDB databases under the restorable account. This helps in scenario + /// where database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableMongodbDatabasesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperations.cs index e948ad895ece..30f5470f7786 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperations.cs @@ -78,23 +78,18 @@ internal RestorableMongodbResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -107,7 +102,6 @@ internal RestorableMongodbResourcesOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +109,6 @@ internal RestorableMongodbResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restoreLocation", restoreLocation); @@ -129,14 +122,14 @@ internal RestorableMongodbResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restoreLocation != null) { @@ -239,7 +232,193 @@ internal RestorableMongodbResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Return a list of database and collection combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperationsExtensions.cs index 3da4174c07cd..693b26a3fd0c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableMongodbResourcesOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class RestorableMongodbResourcesOperationsExtensions /// /// The timestamp when the restorable resources existed. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) { return ((IRestorableMongodbResourcesOperations)operations).ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult(); } @@ -64,12 +64,53 @@ public static partial class RestorableMongodbResourcesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Return a list of database and collection combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableMongodbResourcesOperations operations, string nextPageLink) + { + return ((IRestorableMongodbResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Return a list of database and collection combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableMongodbResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperations.cs index 453d4533b642..d3a13ffc3c85 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperations.cs @@ -81,23 +81,18 @@ internal RestorableSqlContainersOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -111,7 +106,6 @@ internal RestorableSqlContainersOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +113,6 @@ internal RestorableSqlContainersOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restorableSqlDatabaseRid", restorableSqlDatabaseRid); @@ -134,14 +127,14 @@ internal RestorableSqlContainersOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restorableSqlDatabaseRid != null) { @@ -248,7 +241,193 @@ internal RestorableSqlContainersOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// containers under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperationsExtensions.cs index cf2070eab6fe..38fbef534ed7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlContainersOperationsExtensions.cs @@ -37,7 +37,7 @@ public static partial class RestorableSqlContainersOperationsExtensions /// /// Restorable Sql containers event feed end time. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string)) { return ((IRestorableSqlContainersOperations)operations).ListAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime).GetAwaiter().GetResult(); } @@ -70,12 +70,53 @@ public static partial class RestorableSqlContainersOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// containers under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableSqlContainersOperations operations, string nextPageLink) + { + return ((IRestorableSqlContainersOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// containers under a specific database. This helps in scenario where + /// container was accidentally deleted. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableSqlContainersOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperations.cs index e55c1fcfb19f..eb4b805763eb 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperations.cs @@ -73,23 +73,18 @@ internal RestorableSqlDatabasesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -100,7 +95,6 @@ internal RestorableSqlDatabasesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "instanceId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -108,7 +102,6 @@ internal RestorableSqlDatabasesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); @@ -120,15 +113,202 @@ internal RestorableSqlDatabasesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// databases under the restorable account. This helps in scenario where + /// database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -222,7 +402,7 @@ internal RestorableSqlDatabasesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperationsExtensions.cs index 70848eda6a56..934c3e7d555b 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlDatabasesOperationsExtensions.cs @@ -29,7 +29,7 @@ public static partial class RestorableSqlDatabasesOperationsExtensions /// /// The instanceId GUID of a restorable database account. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableSqlDatabasesOperations operations, string location, string instanceId) + public static Microsoft.Rest.Azure.IPage List(this IRestorableSqlDatabasesOperations operations, string location, string instanceId) { return ((IRestorableSqlDatabasesOperations)operations).ListAsync(location, instanceId).GetAwaiter().GetResult(); } @@ -54,12 +54,55 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlDatabasesOperations operations, string location, string instanceId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// databases under the restorable account. This helps in scenario where + /// database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableSqlDatabasesOperations operations, string nextPageLink) + { + return ((IRestorableSqlDatabasesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL + /// databases under the restorable account. This helps in scenario where + /// database was accidentally deleted to get the deletion time. This API + /// requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableSqlDatabasesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperations.cs index 59f4903d1f57..d534615bd9f7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperations.cs @@ -78,23 +78,18 @@ internal RestorableSqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -107,7 +102,6 @@ internal RestorableSqlResourcesOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +109,6 @@ internal RestorableSqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restoreLocation", restoreLocation); @@ -129,14 +122,14 @@ internal RestorableSqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restoreLocation != null) { @@ -239,7 +232,193 @@ internal RestorableSqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Return a list of database and container combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperationsExtensions.cs index fe97dd0fb507..938d2b930524 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableSqlResourcesOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class RestorableSqlResourcesOperationsExtensions /// /// The timestamp when the restorable resources existed. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) { return ((IRestorableSqlResourcesOperations)operations).ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult(); } @@ -64,12 +64,53 @@ public static partial class RestorableSqlResourcesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Return a list of database and container combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableSqlResourcesOperations operations, string nextPageLink) + { + return ((IRestorableSqlResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Return a list of database and container combo that exist on the account at + /// the given timestamp and location. This helps in scenarios to validate what + /// resources exist at given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableSqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperations.cs index a856f5f30f27..689b493045f3 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperations.cs @@ -78,23 +78,18 @@ internal RestorableTableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -107,7 +102,6 @@ internal RestorableTableResourcesOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +109,6 @@ internal RestorableTableResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("restoreLocation", restoreLocation); @@ -129,14 +122,14 @@ internal RestorableTableResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (restoreLocation != null) { @@ -239,7 +232,193 @@ internal RestorableTableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Return a list of tables that exist on the account at the given timestamp + /// and location. This helps in scenarios to validate what resources exist at + /// given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperationsExtensions.cs index d83d356b665a..94cecca05096 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTableResourcesOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class RestorableTableResourcesOperationsExtensions /// /// The timestamp when the restorable resources existed. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableTableResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableTableResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string)) { return ((IRestorableTableResourcesOperations)operations).ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult(); } @@ -64,12 +64,53 @@ public static partial class RestorableTableResourcesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableTableResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableTableResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Return a list of tables that exist on the account at the given timestamp + /// and location. This helps in scenarios to validate what resources exist at + /// given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableTableResourcesOperations operations, string nextPageLink) + { + return ((IRestorableTableResourcesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Return a list of tables that exist on the account at the given timestamp + /// and location. This helps in scenarios to validate what resources exist at + /// given timestamp and location. This API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableTableResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperations.cs index f76a80879412..ecb859815f81 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperations.cs @@ -78,23 +78,18 @@ internal RestorableTablesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (location == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); @@ -107,7 +102,6 @@ internal RestorableTablesOperations (CosmosDBManagementClient client) - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +109,6 @@ internal RestorableTablesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("location", location); tracingParameters.Add("instanceId", instanceId); tracingParameters.Add("startTime", startTime); @@ -129,14 +122,14 @@ internal RestorableTablesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (startTime != null) { @@ -239,7 +232,193 @@ internal RestorableTablesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Tables. This helps in scenario where table was accidentally deleted. This + /// API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperationsExtensions.cs index ee669f17c8ec..b3e5139e0614 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/RestorableTablesOperationsExtensions.cs @@ -34,7 +34,7 @@ public static partial class RestorableTablesOperationsExtensions /// /// Restorable Tables event feed end time. /// - public static System.Collections.Generic.IEnumerable List(this IRestorableTablesOperations operations, string location, string instanceId, string startTime = default(string), string endTime = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IRestorableTablesOperations operations, string location, string instanceId, string startTime = default(string), string endTime = default(string)) { return ((IRestorableTablesOperations)operations).ListAsync(location, instanceId, startTime, endTime).GetAwaiter().GetResult(); } @@ -64,12 +64,53 @@ public static partial class RestorableTablesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRestorableTablesOperations operations, string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRestorableTablesOperations operations, string location, string instanceId, string startTime = default(string), string endTime = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, startTime, endTime, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Tables. This helps in scenario where table was accidentally deleted. This + /// API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IRestorableTablesOperations operations, string nextPageLink) + { + return ((IRestorableTablesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Show the event feed of all mutations done on all the Azure Cosmos DB + /// Tables. This helps in scenario where table was accidentally deleted. This + /// API requires + /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' + /// permission + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IRestorableTablesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperations.cs index 12110ce20c30..f39af034a28a 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperations.cs @@ -68,23 +68,18 @@ internal ServiceOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal ServiceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +123,6 @@ internal ServiceOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -139,14 +132,14 @@ internal ServiceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -241,7 +234,7 @@ internal ServiceOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -278,34 +271,6 @@ internal ServiceOperations (CosmosDBManagementClient client) } - /// - /// Creates a service. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB service name. - /// - /// - /// The Service resource parameters. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, createUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Gets the status of service. /// @@ -345,17 +310,12 @@ internal ServiceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -405,7 +365,6 @@ internal ServiceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "serviceName", 3); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -416,7 +375,6 @@ internal ServiceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -426,15 +384,15 @@ internal ServiceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -566,6 +524,34 @@ internal ServiceOperations (CosmosDBManagementClient client) } + /// + /// Creates a service. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB service name. + /// + /// + /// The Service resource parameters. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, createUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes service with the given serviceName. /// @@ -641,17 +627,12 @@ internal ServiceOperations (CosmosDBManagementClient client) { createUpdateParameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -701,7 +682,6 @@ internal ServiceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "serviceName", 3); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +692,6 @@ internal ServiceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("createUpdateParameters", createUpdateParameters); @@ -723,15 +702,15 @@ internal ServiceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -918,17 +897,12 @@ internal ServiceOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -978,7 +952,6 @@ internal ServiceOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "serviceName", 3); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -989,7 +962,6 @@ internal ServiceOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("serviceName", serviceName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -999,15 +971,15 @@ internal ServiceOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1133,6 +1105,188 @@ internal ServiceOperations (CosmosDBManagementClient client) + } + /// + /// Gets the status of service. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperationsExtensions.cs index 0db90a72e868..9961c0b52f7c 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/ServiceOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class ServiceOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable List(this IServiceOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage List(this IServiceOperations operations, string resourceGroupName, string accountName) { return ((IServiceOperations)operations).ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable List(this /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IServiceOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IServiceOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -52,7 +52,7 @@ public static System.Collections.Generic.IEnumerable List(this } } /// - /// Creates a service. + /// Gets the status of service. /// /// /// The operations group for this extension method. @@ -66,13 +66,13 @@ public static System.Collections.Generic.IEnumerable List(this /// /// Cosmos DB service name. /// - public static ServiceResource Create(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters) + public static ServiceResource Get(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName) { - return ((IServiceOperations)operations).CreateAsync(resourceGroupName, accountName, serviceName, createUpdateParameters).GetAwaiter().GetResult(); + return ((IServiceOperations)operations).GetAsync(resourceGroupName, accountName, serviceName).GetAwaiter().GetResult(); } /// - /// Creates a service. + /// Gets the status of service. /// /// /// The operations group for this extension method. @@ -89,15 +89,15 @@ public static ServiceResource Create(this IServiceOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the status of service. + /// Creates a service. /// /// /// The operations group for this extension method. @@ -111,13 +111,13 @@ public static ServiceResource Create(this IServiceOperations operations, string /// /// Cosmos DB service name. /// - public static ServiceResource Get(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName) + public static ServiceResource Create(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters) { - return ((IServiceOperations)operations).GetAsync(resourceGroupName, accountName, serviceName).GetAwaiter().GetResult(); + return ((IServiceOperations)operations).CreateAsync(resourceGroupName, accountName, serviceName, createUpdateParameters).GetAwaiter().GetResult(); } /// - /// Gets the status of service. + /// Creates a service. /// /// /// The operations group for this extension method. @@ -134,9 +134,9 @@ public static ServiceResource Get(this IServiceOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateAsync(this IServiceOperations operations, string resourceGroupName, string accountName, string serviceName, ServiceResourceCreateUpdateParameters createUpdateParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, serviceName, createUpdateParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -276,5 +276,38 @@ public static ServiceDeleteHeaders BeginDelete(this IServiceOperations operation return _result.Headers; } } + /// + /// Gets the status of service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IServiceOperations operations, string nextPageLink) + { + return ((IServiceOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the status of service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IServiceOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperations.cs index cc7c027a02f9..3fd6f12e2a81 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperations.cs @@ -68,23 +68,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlDatabasesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +123,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -139,14 +132,14 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -208,14 +201,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +217,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -241,7 +229,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -318,17 +306,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -368,7 +351,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -379,7 +361,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); @@ -389,15 +370,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -459,14 +440,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -476,10 +456,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -583,8 +559,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the RUs per second of the SQL database under an existing Azure Cosmos - /// DB database account with the provided name. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. /// /// /// The name of the resource group. The name is case insensitive. @@ -616,23 +592,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListClientEncryptionKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -672,7 +643,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -683,25 +653,24 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListClientEncryptionKeys", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -763,14 +732,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -780,10 +748,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -796,7 +760,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -810,7 +774,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -834,61 +798,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB SQL database - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// The parameters to provide for the RUs per second of the current SQL + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL /// database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -899,30 +810,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the SQL container under an existing Azure Cosmos DB database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. + /// + /// Cosmos DB ClientEncryptionKey name. /// /// /// Headers that will be added to request. @@ -945,23 +834,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlContainersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1001,7 +885,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (clientEncryptionKeyName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clientEncryptionKeyName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1012,25 +900,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientEncryptionKeyName", clientEncryptionKeyName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlContainers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetClientEncryptionKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{clientEncryptionKeyName}", System.Uri.EscapeDataString(clientEncryptionKeyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1092,14 +981,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1109,10 +997,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1125,7 +1009,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1139,7 +1023,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1163,7 +1047,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the SQL container under an existing Azure Cosmos DB database account. + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The name of the resource group. The name is case insensitive. @@ -1174,8 +1059,36 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. + /// + /// Cosmos DB ClientEncryptionKey name. + /// + /// + /// The parameters to provide for the client encryption key. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. /// /// /// Headers that will be added to request. @@ -1198,23 +1111,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlContainersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1254,12 +1162,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (containerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1270,27 +1172,24 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainer", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlContainers", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1352,14 +1251,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1369,10 +1267,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1385,7 +1279,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1399,7 +1293,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1423,7 +1317,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL container + /// Gets the SQL container under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1437,104 +1331,39 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the current SQL container. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlContainerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL container. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> DeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlContainerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the RUs per second of the SQL container under an existing Azure Cosmos - /// DB database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container 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 System.Threading.Tasks.Task> GetSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + /// + /// 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 System.Threading.Tasks.Task> GetSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1579,7 +1408,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1591,26 +1419,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainerThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainer", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1672,14 +1499,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1689,10 +1515,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1705,7 +1527,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1719,7 +1541,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1743,7 +1565,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Create or update an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -1757,9 +1579,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// container. + /// + /// The parameters to provide for the current SQL container. /// /// /// Headers that will be added to request. @@ -1767,16 +1588,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> UpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlContainerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Deletes an existing Azure Cosmos DB SQL container. /// /// /// The name of the resource group. The name is case insensitive. @@ -1796,16 +1616,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlContainerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Retrieves continuous backup information for a container resource. /// /// /// The name of the resource group. The name is case insensitive. @@ -1819,22 +1638,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// + /// + /// The name of the continuous backup restore location. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL - /// database. + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1845,6 +1667,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// /// /// Headers that will be added to request. /// @@ -1866,23 +1691,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListClientEncryptionKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlStoredProceduresWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1922,7 +1742,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (containerName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1933,25 +1757,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("containerName", containerName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListClientEncryptionKeys", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlStoredProcedures", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2046,7 +1871,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2060,7 +1885,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2084,8 +1909,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL - /// database. + /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2096,8 +1921,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB storedProcedure name. /// /// /// Headers that will be added to request. @@ -2120,23 +1948,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2176,12 +1999,16 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (clientEncryptionKeyName == null) + if (containerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clientEncryptionKeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + + if (storedProcedureName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2192,27 +2019,28 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("clientEncryptionKeyName", clientEncryptionKeyName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("storedProcedureName", storedProcedureName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetClientEncryptionKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlStoredProcedure", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{clientEncryptionKeyName}", System.Uri.EscapeDataString(clientEncryptionKeyName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2274,14 +2102,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2291,10 +2118,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2307,7 +2130,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2321,7 +2144,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2345,8 +2168,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The name of the resource group. The name is case insensitive. @@ -2357,11 +2179,14 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// - /// - /// The parameters to provide for the client encryption key. + /// + /// Cosmos DB storedProcedure name. + /// + /// + /// The parameters to provide for the current SQL storedProcedure. /// /// /// Headers that will be added to request. @@ -2369,16 +2194,47 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB storedProcedure name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the SQL container under an existing Azure Cosmos + /// DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2413,23 +2269,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlStoredProceduresWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2474,7 +2325,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2486,26 +2336,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlStoredProcedures", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlContainerThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2567,14 +2416,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2584,10 +2432,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2600,7 +2444,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2614,7 +2458,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2638,8 +2482,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -2653,8 +2496,95 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// The parameters to provide for the RUs per second of the current SQL + /// container. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. /// /// /// Headers that will be added to request. @@ -2677,23 +2607,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlTriggersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2738,12 +2663,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - if (storedProcedureName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2755,28 +2674,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlStoredProcedure", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlTriggers", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2838,14 +2754,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2855,10 +2770,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2871,7 +2782,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2885,7 +2796,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2909,41 +2820,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB storedProcedure name. - /// - /// - /// The parameters to provide for the current SQL storedProcedure. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -2957,37 +2834,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> DeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB - /// database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. + /// + /// Cosmos DB trigger name. /// /// /// Headers that will be added to request. @@ -3010,23 +2858,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3071,7 +2914,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; + if (triggerName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3083,26 +2930,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("triggerName", triggerName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlUserDefinedFunctions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlTrigger", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3164,14 +3012,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3181,10 +3028,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3197,7 +3040,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3211,7 +3054,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3235,8 +3078,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database - /// account. + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The name of the resource group. The name is case insensitive. @@ -3250,8 +3092,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. + /// + /// + /// The parameters to provide for the current SQL trigger. /// /// /// Headers that will be added to request. @@ -3259,38 +3104,93 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } - - - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + /// + /// Deletes an existing Azure Cosmos DB SQL trigger. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB trigger name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container 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 System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3335,12 +3235,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - if (userDefinedFunctionName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userDefinedFunctionName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3352,28 +3246,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("userDefinedFunctionName", userDefinedFunctionName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlUserDefinedFunction", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlUserDefinedFunctions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3435,14 +3326,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3452,10 +3342,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3468,7 +3354,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3482,7 +3368,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3506,41 +3392,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB userDefinedFunction name. - /// - /// - /// The parameters to provide for the current SQL userDefinedFunction. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + /// account. /// /// /// The name of the resource group. The name is case insensitive. @@ -3563,34 +3416,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists the SQL trigger under an existing Azure Cosmos DB database account. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// /// /// Thrown when the operation returned an invalid status code /// @@ -3606,23 +3431,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlTriggersWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3667,7 +3487,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; + if (userDefinedFunctionName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userDefinedFunctionName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3679,26 +3503,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("userDefinedFunctionName", userDefinedFunctionName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlTriggers", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlUserDefinedFunction", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3760,14 +3585,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3777,10 +3601,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3793,7 +3613,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3807,7 +3627,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3831,7 +3651,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the SQL trigger under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The name of the resource group. The name is case insensitive. @@ -3845,8 +3665,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. + /// + /// + /// The parameters to provide for the current SQL userDefinedFunction. /// /// /// Headers that will be added to request. @@ -3854,38 +3677,90 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// 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 System.Threading.Tasks.Task> GetSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. + /// + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB userDefinedFunction name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> DeleteSqlUserDefinedFunctionWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } - - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + /// + /// Gets the RUs per second of the SQL database under an existing Azure Cosmos + /// DB database account with the provided name. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database 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 System.Threading.Tasks.Task> GetSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3925,17 +3800,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (containerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); - } - - if (triggerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3946,29 +3810,24 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlTrigger", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlDatabaseThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4030,14 +3889,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4047,10 +3905,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4063,7 +3917,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4077,7 +3931,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4101,7 +3955,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The name of the resource group. The name is case insensitive. @@ -4112,14 +3966,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// - /// - /// The parameters to provide for the current SQL trigger. + /// + /// The parameters to provide for the RUs per second of the current SQL + /// database. /// /// /// Headers that will be added to request. @@ -4127,15 +3976,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -4146,11 +3995,30 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. + /// + /// Headers that will be added to request. /// - /// - /// Cosmos DB trigger name. + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB database name. /// /// /// Headers that will be added to request. @@ -4158,20 +4026,16 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition - /// with the given Id. + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// @@ -4199,28 +4063,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (roleDefinitionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4255,7 +4109,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4263,28 +4116,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleAssignments", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4379,7 +4229,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4393,7 +4243,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4417,66 +4267,17 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. - /// - /// - /// The GUID for the Role Definition. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The properties required to create or update a Role Definition. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment + /// with the given Id. /// - /// - /// The GUID for the Role Definition. - /// /// /// 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. - /// - public async System.Threading.Tasks.Task DeleteSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -4499,23 +4300,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4550,7 +4346,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4560,24 +4360,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4672,7 +4473,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4686,7 +4487,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4710,30 +4511,79 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment - /// with the given Id. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// /// /// The GUID for the Role Assignment. /// + /// + /// The properties required to create or update a Role Assignment. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateSqlRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// 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 - /// + public async System.Threading.Tasks.Task> DeleteSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// 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 /// @@ -4743,28 +4593,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListSqlRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (roleAssignmentId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4799,7 +4639,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4807,28 +4646,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4923,7 +4759,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4937,7 +4773,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4961,66 +4797,17 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. - /// - /// - /// The GUID for the Role Assignment. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The properties required to create or update a Role Assignment. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition + /// with the given Id. /// - /// - /// The GUID for the Role Assignment. - /// /// /// 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. - /// - public async System.Threading.Tasks.Task DeleteSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -5043,23 +4830,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListSqlRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5094,7 +4876,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5104,24 +4890,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleAssignments", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSqlRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5216,7 +5003,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -5230,7 +5017,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -5254,7 +5041,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a container resource. + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -5262,14 +5049,36 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// - /// - /// Cosmos DB container name. + /// + /// The properties required to create or update a Role Definition. /// - /// - /// The name of the continuous backup restore location. + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateSqlRoleDefinitionParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -5277,10 +5086,10 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -5334,17 +5143,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { createUpdateSqlDatabaseParameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5384,7 +5188,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5395,7 +5198,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); @@ -5406,15 +5208,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5482,14 +5284,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5499,10 +5300,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -5601,17 +5398,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5651,7 +5443,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5662,7 +5453,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); @@ -5672,15 +5462,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5742,14 +5532,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -5759,10 +5548,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -5808,7 +5593,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The name of the resource group. The name is case insensitive. @@ -5819,9 +5605,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// database. + /// + /// Cosmos DB ClientEncryptionKey name. + /// + /// + /// The parameters to provide for the client encryption key. /// /// /// Headers that will be added to request. @@ -5844,31 +5632,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) + if (createUpdateClientEncryptionKeyParameters == null) { - updateThroughputParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateClientEncryptionKeyParameters"); } - if (this.Client.SubscriptionId == null) + if (createUpdateClientEncryptionKeyParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + createUpdateClientEncryptionKeyParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -5908,7 +5691,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (clientEncryptionKeyName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clientEncryptionKeyName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -5919,26 +5706,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("clientEncryptionKeyName", clientEncryptionKeyName); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); + tracingParameters.Add("createUpdateClientEncryptionKeyParameters", createUpdateClientEncryptionKeyParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlDatabaseThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateClientEncryptionKey", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{clientEncryptionKeyName}", System.Uri.EscapeDataString(clientEncryptionKeyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -5976,9 +5764,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) + if(createUpdateClientEncryptionKeyParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateClientEncryptionKeyParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -6006,14 +5794,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6023,10 +5810,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -6039,7 +5822,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6053,7 +5836,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -6067,7 +5850,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -6090,7 +5873,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Create or update an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -6101,6 +5884,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// + /// + /// The parameters to provide for the current SQL container. + /// /// /// Headers that will be added to request. /// @@ -6122,23 +5911,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateSqlContainerParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlContainerParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateSqlContainerParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateSqlContainerParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6178,9 +5970,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; - // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + if (containerName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { @@ -6189,25 +5985,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("createUpdateSqlContainerParameters", createUpdateSqlContainerParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlDatabaseToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlContainer", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6216,7 +6014,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6245,6 +6043,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateSqlContainerParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlContainerParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -6269,14 +6073,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6286,10 +6089,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -6302,7 +6101,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6316,7 +6115,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -6330,7 +6129,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -6353,7 +6152,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Deletes an existing Azure Cosmos DB SQL container. /// /// /// The name of the resource group. The name is case insensitive. @@ -6364,6 +6163,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// /// /// Headers that will be added to request. /// @@ -6373,9 +6175,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -6385,23 +6184,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6441,7 +6235,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - string apiVersion = "2025-10-15"; + if (containerName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6452,25 +6250,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("containerName", containerName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlDatabaseToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlContainer", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6479,7 +6278,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6530,16 +6329,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -6549,10 +6347,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -6565,7 +6359,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6573,27 +6367,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -6616,7 +6392,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL container + /// Retrieves continuous backup information for a container resource. /// /// /// The name of the resource group. The name is case insensitive. @@ -6630,8 +6406,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the current SQL container. + /// + /// The name of the continuous backup restore location. /// /// /// Headers that will be added to request. @@ -6654,31 +6430,23 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateSqlContainerParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlContainerParameters"); - } - if (createUpdateSqlContainerParameters != null) - { - createUpdateSqlContainerParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -6723,7 +6491,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -6735,27 +6502,26 @@ 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("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlContainer", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -6764,7 +6530,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -6793,9 +6559,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateSqlContainerParameters != null) + if(location != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlContainerParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -6856,7 +6622,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -6870,7 +6636,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -6884,7 +6650,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -6907,7 +6673,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB SQL container. + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The name of the resource group. The name is case insensitive. @@ -6921,6 +6687,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// + /// + /// The parameters to provide for the current SQL storedProcedure. + /// /// /// Headers that will be added to request. /// @@ -6930,6 +6702,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -6939,23 +6714,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteSqlContainerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateSqlStoredProcedureParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlStoredProcedureParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateSqlStoredProcedureParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateSqlStoredProcedureParameters.Validate(); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -7000,7 +6778,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; + if (storedProcedureName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -7012,26 +6794,28 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("storedProcedureName", storedProcedureName); + tracingParameters.Add("createUpdateSqlStoredProcedureParameters", createUpdateSqlStoredProcedureParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlContainer", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlStoredProcedure", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -7040,7 +6824,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -7069,6 +6853,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateSqlStoredProcedureParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlStoredProcedureParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -7091,16 +6881,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7110,10 +6899,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -7126,7 +6911,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -7134,9 +6919,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -7159,7 +6962,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The name of the resource group. The name is case insensitive. @@ -7173,9 +6976,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// The parameters to provide for the RUs per second of the current SQL - /// container. + /// + /// Cosmos DB storedProcedure name. /// /// /// Headers that will be added to request. @@ -7186,9 +6988,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -7198,31 +6997,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) + if (this.Client.ApiVersion == null) { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -7267,7 +7053,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; + if (storedProcedureName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -7279,27 +7069,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlContainerThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlStoredProcedure", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -7308,7 +7098,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -7337,12 +7127,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -7365,16 +7149,15 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7384,10 +7167,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -7400,7 +7179,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -7408,27 +7187,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -7451,8 +7212,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The name of the resource group. The name is case insensitive. @@ -7466,6 +7226,10 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// + /// + /// The parameters to provide for the RUs per second of the current SQL + /// container. + /// /// /// Headers that will be added to request. /// @@ -7487,23 +7251,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); + } + if (updateThroughputParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + updateThroughputParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -7548,7 +7315,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -7560,26 +7326,26 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlContainerToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlContainerThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -7588,7 +7354,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -7617,6 +7383,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -7641,14 +7413,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -7658,10 +7429,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -7674,7 +7441,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -7702,7 +7469,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -7725,8 +7492,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -7761,23 +7528,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -7822,7 +7584,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -7834,26 +7595,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlContainerToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlContainerToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -7948,7 +7708,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -7976,7 +7736,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -7999,8 +7759,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -8011,11 +7771,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. - /// - /// - /// The parameters to provide for the client encryption key. + /// + /// Cosmos DB container name. /// /// /// Headers that will be added to request. @@ -8038,31 +7795,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateClientEncryptionKeyParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateClientEncryptionKeyParameters"); - } - if (createUpdateClientEncryptionKeyParameters != null) - { - createUpdateClientEncryptionKeyParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -8102,12 +7846,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (clientEncryptionKeyName == null) + if (containerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "clientEncryptionKeyName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -8118,28 +7861,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("clientEncryptionKeyName", clientEncryptionKeyName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("containerName", containerName); - tracingParameters.Add("createUpdateClientEncryptionKeyParameters", createUpdateClientEncryptionKeyParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateClientEncryptionKey", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlContainerToManualThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{clientEncryptionKeyName}", System.Uri.EscapeDataString(clientEncryptionKeyName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -8148,7 +7889,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -8177,12 +7918,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateClientEncryptionKeyParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateClientEncryptionKeyParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -8240,7 +7975,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -8254,7 +7989,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -8268,7 +8003,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -8291,7 +8026,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The name of the resource group. The name is case insensitive. @@ -8305,11 +8040,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// - /// - /// The parameters to provide for the current SQL storedProcedure. + /// + /// The parameters to provide for the current SQL trigger. /// /// /// Headers that will be added to request. @@ -8332,31 +8067,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateSqlStoredProcedureParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlStoredProcedureParameters"); - } - if (createUpdateSqlStoredProcedureParameters != null) + if (createUpdateSqlTriggerParameters == null) { - createUpdateSqlStoredProcedureParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlTriggerParameters"); } - if (this.Client.SubscriptionId == null) + if (createUpdateSqlTriggerParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + createUpdateSqlTriggerParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -8401,12 +8131,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - if (storedProcedureName == null) + if (triggerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -8418,29 +8147,28 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("createUpdateSqlStoredProcedureParameters", createUpdateSqlStoredProcedureParameters); + tracingParameters.Add("createUpdateSqlTriggerParameters", createUpdateSqlTriggerParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlStoredProcedure", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlTrigger", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -8478,9 +8206,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateSqlStoredProcedureParameters != null) + if(createUpdateSqlTriggerParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlStoredProcedureParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlTriggerParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -8508,14 +8236,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8525,10 +8252,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -8541,7 +8264,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -8555,7 +8278,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -8569,7 +8292,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -8592,7 +8315,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The name of the resource group. The name is case insensitive. @@ -8606,8 +8329,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// /// /// Headers that will be added to request. @@ -8627,23 +8350,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -8688,12 +8406,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } - if (storedProcedureName == null) + if (triggerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "storedProcedureName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -8705,28 +8422,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); tracingParameters.Add("containerName", containerName); - tracingParameters.Add("storedProcedureName", storedProcedureName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("triggerName", triggerName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlStoredProcedure", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlTrigger", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{storedProcedureName}", System.Uri.EscapeDataString(storedProcedureName)); + _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -8788,14 +8504,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -8805,10 +8520,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -8821,7 +8532,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -8831,7 +8542,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -8909,17 +8620,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { createUpdateSqlUserDefinedFunctionParameters.Validate(); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -8969,7 +8675,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userDefinedFunctionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -8982,7 +8687,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); @@ -8993,7 +8697,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -9001,9 +8705,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -9071,14 +8775,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9088,10 +8791,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -9196,18 +8895,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) + + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } @@ -9256,7 +8950,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "userDefinedFunctionName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -9269,7 +8962,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); @@ -9279,7 +8971,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); @@ -9287,9 +8979,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _url = _url.Replace("{userDefinedFunctionName}", System.Uri.EscapeDataString(userDefinedFunctionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -9351,14 +9043,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9368,10 +9059,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -9417,7 +9104,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The name of the resource group. The name is case insensitive. @@ -9428,14 +9115,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// - /// - /// The parameters to provide for the current SQL trigger. + /// + /// The parameters to provide for the RUs per second of the current SQL + /// database. /// /// /// Headers that will be added to request. @@ -9458,31 +9140,26 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateSqlTriggerParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlTriggerParameters"); - } - if (createUpdateSqlTriggerParameters != null) + if (updateThroughputParameters == null) { - createUpdateSqlTriggerParameters.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + updateThroughputParameters.Validate(); } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -9522,17 +9199,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (containerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); - } - - if (triggerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -9543,30 +9209,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("createUpdateSqlTriggerParameters", createUpdateSqlTriggerParameters); + tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlTrigger", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateSqlDatabaseThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -9604,9 +9265,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateSqlTriggerParameters != null) + if(updateThroughputParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlTriggerParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -9634,14 +9295,13 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -9651,10 +9311,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -9667,7 +9323,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -9681,7 +9337,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -9695,7 +9351,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -9718,7 +9374,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -9729,12 +9385,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// /// /// Headers that will be added to request. /// @@ -9744,6 +9394,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -9753,23 +9406,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteSqlTriggerWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -9809,17 +9457,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); } - if (containerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); - } - - if (triggerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "triggerName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -9830,29 +9467,24 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("triggerName", triggerName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlTrigger", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlDatabaseToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{triggerName}", System.Uri.EscapeDataString(triggerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -9861,7 +9493,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -9912,7 +9544,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -9947,7 +9579,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -9955,9 +9587,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -9980,19 +9630,16 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// Cosmos DB database name. /// /// /// Headers that will be added to request. @@ -10015,33 +9662,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateSqlRoleDefinitionParameters == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlRoleDefinitionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (roleDefinitionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -10076,7 +9708,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (databaseName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -10084,29 +9720,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("createUpdateSqlRoleDefinitionParameters", createUpdateSqlRoleDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateSqlDatabaseToManualThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -10115,7 +9749,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -10144,12 +9778,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateSqlRoleDefinitionParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlRoleDefinitionParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -10207,7 +9835,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -10221,7 +9849,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -10233,6 +9861,19 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -10245,17 +9886,20 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. + /// /// /// Headers that will be added to request. /// @@ -10265,6 +9909,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -10274,28 +9921,23 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(string roleDefinitionId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (roleDefinitionId == null) + if (createUpdateSqlRoleAssignmentParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlRoleAssignmentParameters"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -10330,7 +9972,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -10338,28 +9984,28 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); + tracingParameters.Add("createUpdateSqlRoleAssignmentParameters", createUpdateSqlRoleAssignmentParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -10368,7 +10014,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -10397,6 +10043,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateSqlRoleAssignmentParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlRoleAssignmentParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -10419,7 +10071,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10454,7 +10106,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -10462,31 +10114,59 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - if (_shouldTrace) + // Deserialize Response + if ((int)_statusCode == 200) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -10497,9 +10177,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -10509,33 +10186,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateSqlRoleAssignmentParameters == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlRoleAssignmentParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (roleAssignmentId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -10570,7 +10232,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (roleAssignmentId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -10578,29 +10244,27 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); - tracingParameters.Add("createUpdateSqlRoleAssignmentParameters", createUpdateSqlRoleAssignmentParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -10609,7 +10273,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -10638,12 +10302,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateSqlRoleAssignmentParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlRoleAssignmentParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -10666,7 +10324,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10701,7 +10359,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -10709,23 +10367,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -10739,17 +10392,20 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The properties required to create or update a Role Definition. + /// /// /// Headers that will be added to request. /// @@ -10759,6 +10415,9 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -10768,28 +10427,23 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (roleAssignmentId == null) + if (createUpdateSqlRoleDefinitionParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateSqlRoleDefinitionParameters"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -10824,7 +10478,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; + if (roleDefinitionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -10832,28 +10490,28 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); + tracingParameters.Add("createUpdateSqlRoleDefinitionParameters", createUpdateSqlRoleDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateSqlRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -10862,7 +10520,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -10891,6 +10549,12 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateSqlRoleDefinitionParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateSqlRoleDefinitionParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -10913,7 +10577,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -10948,7 +10612,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -10956,6 +10620,37 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -10968,7 +10663,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a container resource. + /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -10976,14 +10671,8 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. - /// - /// - /// The name of the continuous backup restore location. + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -10994,9 +10683,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -11006,28 +10692,18 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -11062,17 +10738,11 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (databaseName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "databaseName"); - } - - if (containerName == null) + if (roleDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -11082,29 +10752,25 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); - tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteSqlRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -11113,7 +10779,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -11142,12 +10808,6 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(location != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -11170,7 +10830,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -11205,7 +10865,7 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -11213,13 +10873,1442 @@ internal SqlResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the SQL databases under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlDatabasesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlDatabasesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListClientEncryptionKeysNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListClientEncryptionKeysNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlContainersNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlContainersNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlStoredProceduresNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlStoredProceduresNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlTriggersNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlTriggersNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlUserDefinedFunctionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlUserDefinedFunctionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleAssignmentsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListSqlRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListSqlRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperationsExtensions.cs index d33b37cfc970..bc35a9579578 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/SqlResourcesOperationsExtensions.cs @@ -24,7 +24,7 @@ public static partial class SqlResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListSqlDatabases(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListSqlDatabases(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) { return ((ISqlResourcesOperations)operations).ListSqlDatabasesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -44,7 +44,7 @@ public static System.Collections.Generic.IEnumerable List /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlDatabasesAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlDatabasesAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListSqlDatabasesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -189,8 +189,8 @@ public static SqlResourcesDeleteSqlDatabaseHeaders DeleteSqlDatabase(this ISqlRe } } /// - /// Gets the RUs per second of the SQL database under an existing Azure Cosmos - /// DB database account with the provided name. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. /// /// /// The operations group for this extension method. @@ -204,14 +204,14 @@ public static SqlResourcesDeleteSqlDatabaseHeaders DeleteSqlDatabase(this ISqlRe /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults GetSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static Microsoft.Rest.Azure.IPage ListClientEncryptionKeys(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).GetSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the SQL database under an existing Azure Cosmos - /// DB database account with the provided name. + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. /// /// /// The operations group for this extension method. @@ -228,35 +228,16 @@ public static ThroughputSettingsGetResults GetSqlDatabaseThroughput(this ISqlRes /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListClientEncryptionKeysAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListClientEncryptionKeysWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB SQL database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. - /// - public static ThroughputSettingsGetResults UpdateSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) - { - return ((ISqlResourcesOperations)operations).UpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); - } - - /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL + /// database. /// /// /// The operations group for this extension method. @@ -270,38 +251,17 @@ public static ThroughputSettingsGetResults UpdateSqlDatabaseThroughput(this ISql /// /// Cosmos DB database name. /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task UpdateSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.UpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB database name. + /// + /// Cosmos DB ClientEncryptionKey name. /// - public static ThroughputSettingsGetResults MigrateSqlDatabaseToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static ClientEncryptionKeyGetResults GetClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) { - return ((ISqlResourcesOperations)operations).MigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL + /// database. /// /// /// The operations group for this extension method. @@ -315,18 +275,22 @@ public static ThroughputSettingsGetResults MigrateSqlDatabaseToAutoscale(this IS /// /// Cosmos DB database name. /// + /// + /// Cosmos DB ClientEncryptionKey name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateSqlDatabaseToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The operations group for this extension method. @@ -340,13 +304,17 @@ public static ThroughputSettingsGetResults MigrateSqlDatabaseToAutoscale(this IS /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults MigrateSqlDatabaseToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB ClientEncryptionKey name. + /// + public static ClientEncryptionKeyGetResults CreateUpdateClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) { - return ((ISqlResourcesOperations)operations).MigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The operations group for this extension method. @@ -360,12 +328,15 @@ public static ThroughputSettingsGetResults MigrateSqlDatabaseToManualThroughput( /// /// Cosmos DB database name. /// + /// + /// Cosmos DB ClientEncryptionKey name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateSqlDatabaseToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -385,7 +356,7 @@ public static ThroughputSettingsGetResults MigrateSqlDatabaseToManualThroughput( /// /// Cosmos DB database name. /// - public static System.Collections.Generic.IEnumerable ListSqlContainers(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static Microsoft.Rest.Azure.IPage ListSqlContainers(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { return ((ISqlResourcesOperations)operations).ListSqlContainersAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } @@ -408,7 +379,7 @@ public static System.Collections.Generic.IEnumerable Lis /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlContainersAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlContainersAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListSqlContainersWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { @@ -569,8 +540,7 @@ public static SqlResourcesDeleteSqlContainerHeaders DeleteSqlContainer(this ISql } } /// - /// Gets the RUs per second of the SQL container under an existing Azure Cosmos - /// DB database account. + /// Retrieves continuous backup information for a container resource. /// /// /// The operations group for this extension method. @@ -587,14 +557,13 @@ public static SqlResourcesDeleteSqlContainerHeaders DeleteSqlContainer(this ISql /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + public static BackupInformation RetrieveContinuousBackupInformation(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location) { - return ((ISqlResourcesOperations)operations).GetSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, location).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the SQL container under an existing Azure Cosmos - /// DB database account. + /// Retrieves continuous backup information for a container resource. /// /// /// The operations group for this extension method. @@ -614,15 +583,16 @@ public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlRe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -639,13 +609,14 @@ public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlRe /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static Microsoft.Rest.Azure.IPage ListSqlStoredProcedures(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).UpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -665,16 +636,16 @@ public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISq /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlStoredProceduresAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSqlStoredProceduresWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -691,14 +662,17 @@ public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISq /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults MigrateSqlContainerToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB storedProcedure name. + /// + public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) { - return ((ISqlResourcesOperations)operations).MigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -715,19 +689,21 @@ public static ThroughputSettingsGetResults MigrateSqlContainerToAutoscale(this I /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateSqlContainerToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The operations group for this extension method. @@ -744,14 +720,16 @@ public static ThroughputSettingsGetResults MigrateSqlContainerToAutoscale(this I /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults MigrateSqlContainerToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB storedProcedure name. + /// + public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) { - return ((ISqlResourcesOperations)operations).MigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The operations group for this extension method. @@ -768,19 +746,21 @@ public static ThroughputSettingsGetResults MigrateSqlContainerToManualThroughput /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateSqlContainerToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL - /// database. + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The operations group for this extension method. @@ -794,14 +774,19 @@ public static ThroughputSettingsGetResults MigrateSqlContainerToManualThroughput /// /// Cosmos DB database name. /// - public static System.Collections.Generic.IEnumerable ListClientEncryptionKeys(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB storedProcedure name. + /// + public static SqlResourcesDeleteSqlStoredProcedureHeaders DeleteSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) { - return ((ISqlResourcesOperations)operations).ListClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).DeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); } /// - /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL - /// database. + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The operations group for this extension method. @@ -815,19 +800,25 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database name. /// + /// + /// Cosmos DB container name. + /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListClientEncryptionKeysAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListClientEncryptionKeysWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL - /// database. + /// Gets the RUs per second of the SQL container under an existing Azure Cosmos + /// DB database account. /// /// /// The operations group for this extension method. @@ -841,17 +832,17 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// - public static ClientEncryptionKeyGetResults GetClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName) + public static ThroughputSettingsGetResults GetSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).GetClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL - /// database. + /// Gets the RUs per second of the SQL container under an existing Azure Cosmos + /// DB database account. /// /// /// The operations group for this extension method. @@ -865,22 +856,21 @@ public static ClientEncryptionKeyGetResults GetClientEncryptionKey(this ISqlReso /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The operations group for this extension method. @@ -894,17 +884,16 @@ public static ClientEncryptionKeyGetResults GetClientEncryptionKey(this ISqlReso /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// - public static ClientEncryptionKeyGetResults CreateUpdateClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) + public static ThroughputSettingsGetResults UpdateSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ISqlResourcesOperations)operations).CreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).UpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The operations group for this extension method. @@ -918,22 +907,22 @@ public static ClientEncryptionKeyGetResults CreateUpdateClientEncryptionKey(this /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -950,14 +939,14 @@ public static ClientEncryptionKeyGetResults CreateUpdateClientEncryptionKey(this /// /// Cosmos DB container name. /// - public static System.Collections.Generic.IEnumerable ListSqlStoredProcedures(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + public static ThroughputSettingsGetResults MigrateSqlContainerToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).ListSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).MigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -977,16 +966,16 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlStoredProceduresAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateSqlContainerToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListSqlStoredProceduresWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1003,17 +992,14 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) + public static ThroughputSettingsGetResults MigrateSqlContainerToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).GetSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).MigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Gets the SQL storedProcedure under an existing Azure Cosmos DB database - /// account. + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -1030,21 +1016,18 @@ public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResour /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateSqlContainerToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -1061,16 +1044,13 @@ public static SqlStoredProcedureGetResults GetSqlStoredProcedure(this ISqlResour /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) + public static Microsoft.Rest.Azure.IPage ListSqlTriggers(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).CreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -1087,21 +1067,18 @@ public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this I /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlTriggersAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSqlTriggersWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -1118,16 +1095,16 @@ public static SqlStoredProcedureGetResults CreateUpdateSqlStoredProcedure(this I /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// - public static SqlResourcesDeleteSqlStoredProcedureHeaders DeleteSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) + public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) { - return ((ISqlResourcesOperations)operations).DeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Gets the SQL trigger under an existing Azure Cosmos DB database account. /// /// /// The operations group for this extension method. @@ -1144,22 +1121,21 @@ public static SqlResourcesDeleteSqlStoredProcedureHeaders DeleteSqlStoredProcedu /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. + /// + /// Cosmos DB trigger name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB - /// database account. + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The operations group for this extension method. @@ -1176,14 +1152,16 @@ public static SqlResourcesDeleteSqlStoredProcedureHeaders DeleteSqlStoredProcedu /// /// Cosmos DB container name. /// - public static System.Collections.Generic.IEnumerable ListSqlUserDefinedFunctions(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB trigger name. + /// + public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters) { - return ((ISqlResourcesOperations)operations).ListSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters).GetAwaiter().GetResult(); } /// - /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB - /// database account. + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The operations group for this extension method. @@ -1200,19 +1178,21 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB container name. /// + /// + /// Cosmos DB trigger name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlUserDefinedFunctionsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListSqlUserDefinedFunctionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database - /// account. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The operations group for this extension method. @@ -1229,17 +1209,16 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// - public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) + public static SqlResourcesDeleteSqlTriggerHeaders DeleteSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) { - return ((ISqlResourcesOperations)operations).GetSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).DeleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); } /// - /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database - /// account. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The operations group for this extension method. @@ -1256,21 +1235,22 @@ public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this IS /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. /// /// /// The operations group for this extension method. @@ -1287,16 +1267,14 @@ public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this IS /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. - /// - public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters) + public static Microsoft.Rest.Azure.IPage ListSqlUserDefinedFunctions(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).CreateUpdateSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. /// /// /// The operations group for this extension method. @@ -1313,21 +1291,19 @@ public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunctio /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlUserDefinedFunctionsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSqlUserDefinedFunctionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -1347,13 +1323,14 @@ public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunctio /// /// Cosmos DB userDefinedFunction name. /// - public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders DeleteSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) + public static SqlUserDefinedFunctionGetResults GetSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) { - return ((ISqlResourcesOperations)operations).DeleteSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database + /// account. /// /// /// The operations group for this extension method. @@ -1376,15 +1353,15 @@ public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders DeleteSqlUserDefin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The operations group for this extension method. @@ -1401,13 +1378,16 @@ public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders DeleteSqlUserDefin /// /// Cosmos DB container name. /// - public static System.Collections.Generic.IEnumerable ListSqlTriggers(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB userDefinedFunction name. + /// + public static SqlUserDefinedFunctionGetResults CreateUpdateSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters) { - return ((ISqlResourcesOperations)operations).ListSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters).GetAwaiter().GetResult(); } /// - /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The operations group for this extension method. @@ -1424,18 +1404,21 @@ public static System.Collections.Generic.IEnumerable ListS /// /// Cosmos DB container name. /// + /// + /// Cosmos DB userDefinedFunction name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlTriggersAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListSqlTriggersWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the SQL trigger under an existing Azure Cosmos DB database account. + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// /// The operations group for this extension method. @@ -1452,16 +1435,16 @@ public static System.Collections.Generic.IEnumerable ListS /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// - public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) + public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders DeleteSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) { - return ((ISqlResourcesOperations)operations).GetSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).DeleteSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); } /// - /// Gets the SQL trigger under an existing Azure Cosmos DB database account. + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// /// The operations group for this extension method. @@ -1478,21 +1461,22 @@ public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations op /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Gets the RUs per second of the SQL database under an existing Azure Cosmos + /// DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -1506,19 +1490,14 @@ public static SqlTriggerGetResults GetSqlTrigger(this ISqlResourcesOperations op /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// - public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters) + public static ThroughputSettingsGetResults GetSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).CreateUpdateSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Gets the RUs per second of the SQL database under an existing Azure Cosmos + /// DB database account with the provided name. /// /// /// The operations group for this extension method. @@ -1532,24 +1511,18 @@ public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOper /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. @@ -1563,19 +1536,13 @@ public static SqlTriggerGetResults CreateUpdateSqlTrigger(this ISqlResourcesOper /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// - public static SqlResourcesDeleteSqlTriggerHeaders DeleteSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) + public static ThroughputSettingsGetResults UpdateSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ISqlResourcesOperations)operations).DeleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).UpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. @@ -1589,158 +1556,108 @@ public static SqlResourcesDeleteSqlTriggerHeaders DeleteSqlTrigger(this ISqlReso /// /// Cosmos DB database name. /// - /// - /// Cosmos DB container name. - /// - /// - /// Cosmos DB trigger name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition - /// with the given Id. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleDefinitionGetResults GetSqlRoleDefinition(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults MigrateSqlDatabaseToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).GetSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).MigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition - /// with the given Id. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateSqlDatabaseToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleDefinitionGetResults CreateUpdateSqlRoleDefinition(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults MigrateSqlDatabaseToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).CreateUpdateSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).MigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateSqlDatabaseToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The GUID for the Role Definition. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - public static void DeleteSqlRoleDefinition(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName) - { - ((ISqlResourcesOperations)operations).DeleteSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The GUID for the Role Definition. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - (await operations.DeleteSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. /// /// /// The operations group for this extension method. @@ -1751,13 +1668,13 @@ public static void DeleteSqlRoleDefinition(this ISqlResourcesOperations operatio /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListSqlRoleDefinitions(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListSqlRoleAssignments(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) { - return ((ISqlResourcesOperations)operations).ListSqlRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListSqlRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. /// /// /// The operations group for this extension method. @@ -1771,9 +1688,9 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlRoleDefinitionsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlRoleAssignmentsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListSqlRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSqlRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1785,18 +1702,18 @@ public static System.Collections.Generic.IEnumerable /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleAssignmentGetResults GetSqlRoleAssignment(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName) + /// + /// The GUID for the Role Assignment. + /// + public static SqlRoleAssignmentGetResults GetSqlRoleAssignment(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ISqlResourcesOperations)operations).GetSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// @@ -1806,21 +1723,21 @@ public static SqlRoleAssignmentGetResults GetSqlRoleAssignment(this ISqlResource /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1831,18 +1748,18 @@ public static SqlRoleAssignmentGetResults GetSqlRoleAssignment(this ISqlResource /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleAssignmentGetResults CreateUpdateSqlRoleAssignment(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) + /// + /// The GUID for the Role Assignment. + /// + public static SqlRoleAssignmentGetResults CreateUpdateSqlRoleAssignment(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { - return ((ISqlResourcesOperations)operations).CreateUpdateSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateSqlRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateSqlRoleAssignmentParameters).GetAwaiter().GetResult(); } /// @@ -1851,21 +1768,21 @@ public static SqlRoleAssignmentGetResults CreateUpdateSqlRoleAssignment(this ISq /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateSqlRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -1876,18 +1793,18 @@ public static SqlRoleAssignmentGetResults CreateUpdateSqlRoleAssignment(this ISq /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void DeleteSqlRoleAssignment(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName) + /// + /// The GUID for the Role Assignment. + /// + public static SqlResourcesDeleteSqlRoleAssignmentHeaders DeleteSqlRoleAssignment(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - ((ISqlResourcesOperations)operations).DeleteSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).DeleteSqlRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// @@ -1896,24 +1813,27 @@ public static void DeleteSqlRoleAssignment(this ISqlResourcesOperations operatio /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. /// /// /// The operations group for this extension method. @@ -1924,13 +1844,13 @@ public static void DeleteSqlRoleAssignment(this ISqlResourcesOperations operatio /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListSqlRoleAssignments(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListSqlRoleDefinitions(this ISqlResourcesOperations operations, string resourceGroupName, string accountName) { - return ((ISqlResourcesOperations)operations).ListSqlRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).ListSqlRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. /// /// /// The operations group for this extension method. @@ -1944,15 +1864,16 @@ public static System.Collections.Generic.IEnumerable /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListSqlRoleAssignmentsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListSqlRoleDefinitionsAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListSqlRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSqlRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a container resource. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition + /// with the given Id. /// /// /// The operations group for this extension method. @@ -1963,19 +1884,17 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. + /// + /// The GUID for the Role Definition. /// - public static BackupInformation RetrieveContinuousBackupInformation(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location) + public static SqlRoleDefinitionGetResults GetSqlRoleDefinition(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) { - return ((ISqlResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, location).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).GetSqlRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a container resource. + /// Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition + /// with the given Id. /// /// /// The operations group for this extension method. @@ -1986,24 +1905,21 @@ public static BackupInformation RetrieveContinuousBackupInformation(this ISqlRes /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB SQL database + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// /// /// The operations group for this extension method. @@ -2014,16 +1930,16 @@ public static BackupInformation RetrieveContinuousBackupInformation(this ISqlRes /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// - public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) + public static SqlRoleDefinitionGetResults CreateUpdateSqlRoleDefinition(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).CreateUpdateSqlRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateSqlRoleDefinitionParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL database + /// Creates or updates an Azure Cosmos DB SQL Role Definition. /// /// /// The operations group for this extension method. @@ -2034,21 +1950,21 @@ public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResour /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlDatabaseAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateSqlRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL database. + /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// /// /// The operations group for this extension method. @@ -2059,16 +1975,16 @@ public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResour /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// - public static SqlResourcesDeleteSqlDatabaseHeaders BeginDeleteSqlDatabase(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static SqlResourcesDeleteSqlRoleDefinitionHeaders DeleteSqlRoleDefinition(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) { - return ((ISqlResourcesOperations)operations).BeginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).DeleteSqlRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL database. + /// Deletes an existing Azure Cosmos DB SQL Role Definition. /// /// /// The operations group for this extension method. @@ -2079,21 +1995,21 @@ public static SqlResourcesDeleteSqlDatabaseHeaders BeginDeleteSqlDatabase(this I /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlDatabaseAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteSqlDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Create or update an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. @@ -2107,13 +2023,13 @@ public static SqlResourcesDeleteSqlDatabaseHeaders BeginDeleteSqlDatabase(this I /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static SqlDatabaseGetResults BeginCreateUpdateSqlDatabase(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { - return ((ISqlResourcesOperations)operations).BeginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB SQL database + /// Create or update an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. @@ -2130,15 +2046,15 @@ public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlDatabaseAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateSqlDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB SQL database. /// /// /// The operations group for this extension method. @@ -2152,13 +2068,13 @@ public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + public static SqlResourcesDeleteSqlDatabaseHeaders BeginDeleteSqlDatabase(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).BeginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginDeleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB SQL database. /// /// /// The operations group for this extension method. @@ -2175,15 +2091,16 @@ public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToAutoscale(th /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateSqlDatabaseToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteSqlDatabaseAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSqlDatabaseWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The operations group for this extension method. @@ -2197,13 +2114,17 @@ public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToAutoscale(th /// /// Cosmos DB database name. /// - public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) + /// + /// Cosmos DB ClientEncryptionKey name. + /// + public static ClientEncryptionKeyGetResults BeginCreateUpdateClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) { - return ((ISqlResourcesOperations)operations).BeginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput + /// Create or update a ClientEncryptionKey. This API is meant to be invoked via + /// tools such as the Azure Powershell (instead of directly). /// /// /// The operations group for this extension method. @@ -2217,12 +2138,15 @@ public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToManualThroug /// /// Cosmos DB database name. /// + /// + /// Cosmos DB ClientEncryptionKey name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateSqlDatabaseToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -2330,7 +2254,7 @@ public static SqlResourcesDeleteSqlContainerHeaders BeginDeleteSqlContainer(this } } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Retrieves continuous backup information for a container resource. /// /// /// The operations group for this extension method. @@ -2347,13 +2271,13 @@ public static SqlResourcesDeleteSqlContainerHeaders BeginDeleteSqlContainer(this /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static BackupInformation BeginRetrieveContinuousBackupInformation(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location) { - return ((ISqlResourcesOperations)operations).BeginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, location).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB SQL container + /// Retrieves continuous backup information for a container resource. /// /// /// The operations group for this extension method. @@ -2373,16 +2297,15 @@ public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(thi /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The operations group for this extension method. @@ -2399,14 +2322,16 @@ public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(thi /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults BeginMigrateSqlContainerToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB storedProcedure name. + /// + public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) { - return ((ISqlResourcesOperations)operations).BeginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL container from manual throughput to - /// autoscale + /// Create or update an Azure Cosmos DB SQL storedProcedure /// /// /// The operations group for this extension method. @@ -2423,19 +2348,21 @@ public static ThroughputSettingsGetResults BeginMigrateSqlContainerToAutoscale(t /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateSqlContainerToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The operations group for this extension method. @@ -2452,14 +2379,16 @@ public static ThroughputSettingsGetResults BeginMigrateSqlContainerToAutoscale(t /// /// Cosmos DB container name. /// - public static ThroughputSettingsGetResults BeginMigrateSqlContainerToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) + /// + /// Cosmos DB storedProcedure name. + /// + public static SqlResourcesDeleteSqlStoredProcedureHeaders BeginDeleteSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) { - return ((ISqlResourcesOperations)operations).BeginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB SQL container from autoscale to manual - /// throughput + /// Deletes an existing Azure Cosmos DB SQL storedProcedure. /// /// /// The operations group for this extension method. @@ -2476,19 +2405,21 @@ public static ThroughputSettingsGetResults BeginMigrateSqlContainerToManualThrou /// /// Cosmos DB container name. /// + /// + /// Cosmos DB storedProcedure name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateSqlContainerToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The operations group for this extension method. @@ -2502,17 +2433,16 @@ public static ThroughputSettingsGetResults BeginMigrateSqlContainerToManualThrou /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// - public static ClientEncryptionKeyGetResults BeginCreateUpdateClientEncryptionKey(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) + public static ThroughputSettingsGetResults BeginUpdateSqlContainerThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginUpdateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Create or update a ClientEncryptionKey. This API is meant to be invoked via - /// tools such as the Azure Powershell (instead of directly). + /// Update RUs per second of an Azure Cosmos DB SQL container /// /// /// The operations group for this extension method. @@ -2526,21 +2456,22 @@ public static ClientEncryptionKeyGetResults BeginCreateUpdateClientEncryptionKey /// /// Cosmos DB database name. /// - /// - /// Cosmos DB ClientEncryptionKey name. + /// + /// Cosmos DB container name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateClientEncryptionKeyAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateSqlContainerThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateClientEncryptionKeyWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateSqlContainerThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -2557,16 +2488,14 @@ public static ClientEncryptionKeyGetResults BeginCreateUpdateClientEncryptionKey /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters) + public static ThroughputSettingsGetResults BeginMigrateSqlContainerToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginMigrateSqlContainerToAutoscaleAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL storedProcedure + /// Migrate an Azure Cosmos DB SQL container from manual throughput to + /// autoscale /// /// /// The operations group for this extension method. @@ -2583,21 +2512,19 @@ public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(t /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateSqlContainerToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSqlStoredProcedureParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateSqlContainerToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -2614,16 +2541,14 @@ public static SqlStoredProcedureGetResults BeginCreateUpdateSqlStoredProcedure(t /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// - public static SqlResourcesDeleteSqlStoredProcedureHeaders BeginDeleteSqlStoredProcedure(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName) + public static ThroughputSettingsGetResults BeginMigrateSqlContainerToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName) { - return ((ISqlResourcesOperations)operations).BeginDeleteSqlStoredProcedureAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginMigrateSqlContainerToManualThroughputAsync(resourceGroupName, accountName, databaseName, containerName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL storedProcedure. + /// Migrate an Azure Cosmos DB SQL container from autoscale to manual + /// throughput /// /// /// The operations group for this extension method. @@ -2640,21 +2565,18 @@ public static SqlResourcesDeleteSqlStoredProcedureHeaders BeginDeleteSqlStoredPr /// /// Cosmos DB container name. /// - /// - /// Cosmos DB storedProcedure name. - /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlStoredProcedureAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string storedProcedureName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateSqlContainerToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteSqlStoredProcedureWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, storedProcedureName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateSqlContainerToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The operations group for this extension method. @@ -2671,16 +2593,16 @@ public static SqlResourcesDeleteSqlStoredProcedureHeaders BeginDeleteSqlStoredPr /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// - public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters) + public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL userDefinedFunction + /// Create or update an Azure Cosmos DB SQL trigger /// /// /// The operations group for this extension method. @@ -2697,21 +2619,21 @@ public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFu /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The operations group for this extension method. @@ -2728,16 +2650,16 @@ public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFu /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// - public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders BeginDeleteSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) + public static SqlResourcesDeleteSqlTriggerHeaders BeginDeleteSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) { - return ((ISqlResourcesOperations)operations).BeginDeleteSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginDeleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. + /// Deletes an existing Azure Cosmos DB SQL trigger. /// /// /// The operations group for this extension method. @@ -2754,21 +2676,21 @@ public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders BeginDeleteSqlUser /// /// Cosmos DB container name. /// - /// - /// Cosmos DB userDefinedFunction name. + /// + /// Cosmos DB trigger name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The operations group for this extension method. @@ -2785,16 +2707,16 @@ public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders BeginDeleteSqlUser /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// - public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters) + public static SqlUserDefinedFunctionGetResults BeginCreateUpdateSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB SQL trigger + /// Create or update an Azure Cosmos DB SQL userDefinedFunction /// /// /// The operations group for this extension method. @@ -2811,21 +2733,21 @@ public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResource /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSqlTriggerParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSqlUserDefinedFunctionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// /// The operations group for this extension method. @@ -2842,16 +2764,16 @@ public static SqlTriggerGetResults BeginCreateUpdateSqlTrigger(this ISqlResource /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// - public static SqlResourcesDeleteSqlTriggerHeaders BeginDeleteSqlTrigger(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName) + public static SqlResourcesDeleteSqlUserDefinedFunctionHeaders BeginDeleteSqlUserDefinedFunction(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName) { - return ((ISqlResourcesOperations)operations).BeginDeleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginDeleteSqlUserDefinedFunctionAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL trigger. + /// Deletes an existing Azure Cosmos DB SQL userDefinedFunction. /// /// /// The operations group for this extension method. @@ -2868,195 +2790,201 @@ public static SqlResourcesDeleteSqlTriggerHeaders BeginDeleteSqlTrigger(this ISq /// /// Cosmos DB container name. /// - /// - /// Cosmos DB trigger name. + /// + /// Cosmos DB userDefinedFunction name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlTriggerAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string triggerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteSqlUserDefinedFunctionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, string userDefinedFunctionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteSqlTriggerWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSqlUserDefinedFunctionWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleDefinitionGetResults BeginCreateUpdateSqlRoleDefinition(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginUpdateSqlDatabaseThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// Update RUs per second of an Azure Cosmos DB SQL database /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateSqlDatabaseThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, createUpdateSqlRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateSqlDatabaseThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void BeginDeleteSqlRoleDefinition(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToAutoscale(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - ((ISqlResourcesOperations)operations).BeginDeleteSqlRoleDefinitionAsync(roleDefinitionId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Definition. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string roleDefinitionId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateSqlDatabaseToAutoscaleAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(roleDefinitionId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginMigrateSqlDatabaseToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static SqlRoleAssignmentGetResults BeginCreateUpdateSqlRoleAssignment(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) + /// + /// Cosmos DB database name. + /// + public static ThroughputSettingsGetResults BeginMigrateSqlDatabaseToManualThroughput(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName) { - return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB SQL Role Assignment. + /// Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB database name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateSqlDatabaseToManualThroughputAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, createUpdateSqlRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateSqlDatabaseToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// - public static void BeginDeleteSqlRoleAssignment(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName) + /// + /// The GUID for the Role Assignment. + /// + public static SqlRoleAssignmentGetResults BeginCreateUpdateSqlRoleAssignment(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { - ((ISqlResourcesOperations)operations).BeginDeleteSqlRoleAssignmentAsync(roleAssignmentId, resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateSqlRoleAssignmentParameters).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB SQL Role Assignment. + /// Creates or updates an Azure Cosmos DB SQL Role Assignment. /// /// /// The operations group for this extension method. /// - /// - /// The GUID for the Role Assignment. - /// /// /// The name of the resource group. The name is case insensitive. /// /// /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Assignment. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string roleAssignmentId, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(roleAssignmentId, resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateUpdateSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateSqlRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } /// - /// Retrieves continuous backup information for a container resource. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// /// The operations group for this extension method. @@ -3067,19 +2995,16 @@ public static void BeginDeleteSqlRoleAssignment(this ISqlResourcesOperations ope /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. + /// + /// The GUID for the Role Assignment. /// - public static BackupInformation BeginRetrieveContinuousBackupInformation(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location) + public static SqlResourcesDeleteSqlRoleAssignmentHeaders BeginDeleteSqlRoleAssignment(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ISqlResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, location).GetAwaiter().GetResult(); + return ((ISqlResourcesOperations)operations).BeginDeleteSqlRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a container resource. + /// Deletes an existing Azure Cosmos DB SQL Role Assignment. /// /// /// The operations group for this extension method. @@ -3090,18 +3015,375 @@ public static BackupInformation BeginRetrieveContinuousBackupInformation(this IS /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB database name. - /// - /// - /// Cosmos DB container name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteSqlRoleAssignmentAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, databaseName, containerName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static SqlRoleDefinitionGetResults BeginCreateUpdateSqlRoleDefinition(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) + { + return ((ISqlResourcesOperations)operations).BeginCreateUpdateSqlRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateSqlRoleDefinitionParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Azure Cosmos DB SQL Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateUpdateSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginCreateUpdateSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateSqlRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static SqlResourcesDeleteSqlRoleDefinitionHeaders BeginDeleteSqlRoleDefinition(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ISqlResourcesOperations)operations).BeginDeleteSqlRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB SQL Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteSqlRoleDefinitionAsync(this ISqlResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginDeleteSqlRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Lists the SQL databases under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlDatabasesNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlDatabasesNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the SQL databases under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlDatabasesNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlDatabasesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListClientEncryptionKeysNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListClientEncryptionKeysNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL + /// database. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListClientEncryptionKeysNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListClientEncryptionKeysNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlContainersNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlContainersNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the SQL container under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlContainersNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlContainersNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlStoredProceduresNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlStoredProceduresNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the SQL storedProcedure under an existing Azure Cosmos DB database + /// account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlStoredProceduresNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlStoredProceduresNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlTriggersNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlTriggersNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the SQL trigger under an existing Azure Cosmos DB database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlTriggersNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlTriggersNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlUserDefinedFunctionsNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlUserDefinedFunctionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the SQL userDefinedFunction under an existing Azure Cosmos DB + /// database account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlUserDefinedFunctionsNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlUserDefinedFunctionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlRoleAssignmentsNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlRoleAssignmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Assignments. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlRoleAssignmentsNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlRoleAssignmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListSqlRoleDefinitionsNext(this ISqlResourcesOperations operations, string nextPageLink) + { + return ((ISqlResourcesOperations)operations).ListSqlRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB SQL Role Definitions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListSqlRoleDefinitionsNextAsync(this ISqlResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListSqlRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperations.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperations.cs index 252136006698..d60eb3a117a7 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperations.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperations.cs @@ -39,7 +39,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) public CosmosDBManagementClient Client { get; private set; } /// - /// Lists the Tables under an existing Azure Cosmos DB database account. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The name of the resource group. The name is case insensitive. @@ -68,23 +68,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListTableRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -119,7 +114,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,24 +123,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTables", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleAssignments", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -208,14 +201,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +217,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -241,7 +229,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -255,7 +243,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -279,8 +267,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Gets the Tables under an existing Azure Cosmos DB database account with the - /// provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Assignment with the given Id. /// /// /// The name of the resource group. The name is case insensitive. @@ -288,8 +276,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -312,23 +300,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -363,12 +346,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) + if (roleAssignmentId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -378,26 +360,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTableRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -459,14 +440,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -476,10 +456,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -492,7 +468,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -506,7 +482,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -530,7 +506,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -538,11 +514,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - /// - /// The parameters to provide for the current Table. + /// + /// The properties required to create or update a Role Assignment. /// /// /// Headers that will be added to request. @@ -550,15 +526,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -566,8 +542,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -575,16 +551,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Gets the RUs per second of the Table under an existing Azure Cosmos DB - /// database account with the provided name. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// /// The name of the resource group. The name is case insensitive. @@ -592,9 +567,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. - /// /// /// Headers that will be added to request. /// @@ -616,23 +588,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListTableRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -667,12 +634,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); - } - - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -682,26 +643,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTableThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleDefinitions", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -763,14 +721,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -780,10 +737,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -796,7 +749,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -810,7 +763,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -833,112 +786,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } - /// - /// Update RUs per second of an Azure Cosmos DB Table - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB table name. - /// - /// - /// The parameters to provide for the RUs per second of the current Table. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> UpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB table name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB table name. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> MigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves continuous backup information for a table. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// Cosmos DB table name. - /// - /// - /// The name of the continuous backup restore location. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Retrieves the properties of an existing Azure Cosmos DB Table Role /// Definition with the given Id. @@ -979,17 +826,12 @@ internal TableResourcesOperations (CosmosDBManagementClient client) - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1029,7 +871,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1040,7 +881,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("roleDefinitionId", roleDefinitionId); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1050,15 +890,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1120,11 +960,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1239,7 +1079,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// Lists the Tables under an existing Azure Cosmos DB database account. /// /// /// The name of the resource group. The name is case insensitive. @@ -1268,23 +1108,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListTableRoleDefinitionsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListTablesWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1319,7 +1154,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1329,24 +1163,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleDefinitions", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTables", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1408,11 +1241,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1436,7 +1269,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1450,7 +1283,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1474,8 +1307,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Assignment with the given Id. + /// Gets the Tables under an existing Azure Cosmos DB database account with the + /// provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -1483,8 +1316,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// Headers that will be added to request. @@ -1507,24 +1340,19 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) + + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } @@ -1558,12 +1386,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (roleAssignmentId == null) + if (tableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1573,26 +1400,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTableRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1654,11 +1480,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1682,7 +1508,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1696,7 +1522,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1720,7 +1546,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Create or update an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -1728,11 +1554,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// The parameters to provide for the current Table. /// /// /// Headers that will be added to request. @@ -1740,15 +1566,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The name of the resource group. The name is case insensitive. @@ -1756,8 +1582,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// Headers that will be added to request. @@ -1765,15 +1591,44 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> DeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// Retrieves continuous backup information for a table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// The name of the continuous backup restore location. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the RUs per second of the Table under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The name of the resource group. The name is case insensitive. @@ -1781,6 +1636,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// + /// + /// Cosmos DB table name. + /// /// /// Headers that will be added to request. /// @@ -1802,23 +1660,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListTableRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1853,7 +1706,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - string apiVersion = "2024-12-01-preview"; + if (tableName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1863,24 +1720,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleAssignments", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetTableThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1942,11 +1800,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1970,7 +1828,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1984,7 +1842,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2008,7 +1866,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Create or update an Azure Cosmos DB Table + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -2019,8 +1877,86 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// - /// - /// The parameters to provide for the current Table. + /// + /// The parameters to provide for the RUs per second of the current Table. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginUpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Cosmos DB table name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginMigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Assignment. + /// + /// + /// The properties required to create or update a Role Assignment. /// /// /// Headers that will be added to request. @@ -2043,31 +1979,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateTableParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableParameters"); - } - if (createUpdateTableParameters != null) - { - createUpdateTableParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (createUpdateTableRoleAssignmentParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableRoleAssignmentParameters"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2102,12 +2030,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) + if (roleAssignmentId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2117,27 +2044,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); - tracingParameters.Add("createUpdateTableParameters", createUpdateTableParameters); + tracingParameters.Add("createUpdateTableRoleAssignmentParameters", createUpdateTableRoleAssignmentParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTableRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2175,9 +2101,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateTableParameters != null) + if(createUpdateTableRoleAssignmentParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableRoleAssignmentParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -2205,14 +2131,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2222,10 +2147,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2238,7 +2159,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2252,7 +2173,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2266,7 +2187,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -2289,7 +2210,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The name of the resource group. The name is case insensitive. @@ -2297,8 +2218,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// Headers that will be added to request. @@ -2318,23 +2239,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2369,12 +2285,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) + if (roleAssignmentId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2384,26 +2299,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleAssignmentId", roleAssignmentId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTable", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTableRoleAssignment", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2463,16 +2377,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2482,10 +2395,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2498,7 +2407,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2508,7 +2417,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -2531,7 +2440,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -2539,11 +2448,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// - /// - /// The parameters to provide for the RUs per second of the current Table. + /// + /// The properties required to create or update a Role Definition. /// /// /// Headers that will be added to request. @@ -2566,31 +2475,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginUpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (updateThroughputParameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); - } - if (updateThroughputParameters != null) - { - updateThroughputParameters.Validate(); - } - if (this.Client.SubscriptionId == null) + if (createUpdateTableRoleDefinitionParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableRoleDefinitionParameters"); } - if (this.Client.SubscriptionId != null) + + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2625,12 +2526,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) + if (roleDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2640,27 +2540,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); - tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); + tracingParameters.Add("createUpdateTableRoleDefinitionParameters", createUpdateTableRoleDefinitionParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTableThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTableRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2698,9 +2597,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(updateThroughputParameters != null) + if(createUpdateTableRoleDefinitionParameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableRoleDefinitionParameters, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -2728,14 +2627,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2745,10 +2643,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -2761,7 +2655,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -2775,7 +2669,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2789,7 +2683,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -2812,7 +2706,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// /// The name of the resource group. The name is case insensitive. @@ -2820,8 +2714,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// Headers that will be added to request. @@ -2832,9 +2726,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -2844,23 +2735,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -2895,12 +2781,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (tableName == null) + if (roleDefinitionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2910,26 +2795,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("roleDefinitionId", roleDefinitionId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateTableToAutoscale", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTableRoleDefinition", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); + _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -2938,7 +2822,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -2989,16 +2873,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3008,10 +2891,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3024,7 +2903,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3032,27 +2911,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3075,7 +2936,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Create or update an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -3086,6 +2947,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// + /// + /// The parameters to provide for the current Table. + /// /// /// Headers that will be added to request. /// @@ -3107,23 +2971,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginMigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateUpdateTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (createUpdateTableParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableParameters"); } - if (this.Client.SubscriptionId != null) + if (createUpdateTableParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + createUpdateTableParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3163,7 +3030,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3174,25 +3040,25 @@ 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); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateTableToManualThroughput", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3201,7 +3067,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3230,6 +3096,12 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(createUpdateTableParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -3254,14 +3126,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3271,10 +3142,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3287,7 +3154,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3301,7 +3168,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3315,7 +3182,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3338,7 +3205,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Retrieves continuous backup information for a table. + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The name of the resource group. The name is case insensitive. @@ -3349,9 +3216,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB table name. /// - /// - /// The name of the continuous backup restore location. - /// /// /// Headers that will be added to request. /// @@ -3361,9 +3225,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -3373,28 +3234,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteTableWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (location == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3434,7 +3285,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2025-10-15"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3445,26 +3295,24 @@ internal TableResourcesOperations (CosmosDBManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("tableName", tableName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTable", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3473,7 +3321,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3502,12 +3350,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(location != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -3530,16 +3372,15 @@ internal TableResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3549,10 +3390,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3565,7 +3402,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3573,23 +3410,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { @@ -3603,7 +3435,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Retrieves continuous backup information for a table. /// /// /// The name of the resource group. The name is case insensitive. @@ -3611,11 +3443,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - /// - /// The properties required to create or update a Role Definition. + /// + /// The name of the continuous backup restore location. /// /// /// Headers that will be added to request. @@ -3638,28 +3470,23 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateTableRoleDefinitionParameters == null) + if (location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableRoleDefinitionParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "location"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3694,12 +3521,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (roleDefinitionId == null) + if (tableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3709,27 +3535,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("roleDefinitionId", roleDefinitionId); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); - tracingParameters.Add("createUpdateTableRoleDefinitionParameters", createUpdateTableRoleDefinitionParameters); + tracingParameters.Add("location", location); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTableRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginRetrieveContinuousBackupInformation", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3738,7 +3563,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -3767,9 +3592,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateTableRoleDefinitionParameters != null) + if(location != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableRoleDefinitionParameters, this.Client.SerializationSettings); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(location, this.Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -3797,13 +3622,14 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3813,6 +3639,10 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -3825,7 +3655,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -3839,7 +3669,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -3853,7 +3683,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -3876,7 +3706,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The name of the resource group. The name is case insensitive. @@ -3884,8 +3714,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. + /// + /// + /// The parameters to provide for the RUs per second of the current Table. /// /// /// Headers that will be added to request. @@ -3896,6 +3729,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -3905,23 +3741,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleDefinitionId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginUpdateTableThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (updateThroughputParameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "updateThroughputParameters"); } - if (this.Client.SubscriptionId != null) + if (updateThroughputParameters != null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + updateThroughputParameters.Validate(); + } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -3956,12 +3795,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (roleDefinitionId == null) + if (tableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleDefinitionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3971,26 +3809,26 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("roleDefinitionId", roleDefinitionId); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("updateThroughputParameters", updateThroughputParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTableRoleDefinition", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTableThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{roleDefinitionId}", System.Uri.EscapeDataString(roleDefinitionId)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -3999,7 +3837,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4028,6 +3866,12 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; + if(updateThroughputParameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(updateThroughputParameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -4050,13 +3894,13 @@ internal TableResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -4080,7 +3924,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4088,9 +3932,27 @@ internal TableResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4113,7 +3975,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The name of the resource group. The name is case insensitive. @@ -4121,11 +3983,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. - /// - /// - /// The properties required to create or update a Role Assignment. + /// + /// Cosmos DB table name. /// /// /// Headers that will be added to request. @@ -4148,28 +4007,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateTableToAutoscaleWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (createUpdateTableRoleAssignmentParameters == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "createUpdateTableRoleAssignmentParameters"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) - { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4204,12 +4053,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (roleAssignmentId == null) + if (tableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4219,27 +4067,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); - tracingParameters.Add("createUpdateTableRoleAssignmentParameters", createUpdateTableRoleAssignmentParameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateUpdateTableRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateTableToAutoscale", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4248,7 +4094,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4277,12 +4123,6 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } // Serialize Request string _requestContent = null; - if(createUpdateTableRoleAssignmentParameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(createUpdateTableRoleAssignmentParameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -4307,13 +4147,14 @@ internal TableResourcesOperations (CosmosDBManagementClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4323,6 +4164,10 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4335,7 +4180,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4349,7 +4194,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -4363,7 +4208,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4386,7 +4231,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The name of the resource group. The name is case insensitive. @@ -4394,8 +4239,8 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// Headers that will be added to request. @@ -4406,6 +4251,9 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -4415,23 +4263,18 @@ internal TableResourcesOperations (CosmosDBManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(string resourceGroupName, string accountName, string roleAssignmentId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMigrateTableToManualThroughputWithHttpMessagesAsync(string resourceGroupName, string accountName, string tableName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.SubscriptionId != null) + if (this.Client.ApiVersion == null) { - if (this.Client.SubscriptionId.Length < 1) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); @@ -4466,12 +4309,11 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); } } - if (roleAssignmentId == null) + if (tableName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "roleAssignmentId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2024-12-01-preview"; // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4481,26 +4323,25 @@ internal TableResourcesOperations (CosmosDBManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("roleAssignmentId", roleAssignmentId); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteTableRoleAssignment", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMigrateTableToManualThroughput", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{roleAssignmentId}", System.Uri.EscapeDataString(roleAssignmentId)); + _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (apiVersion != null) + if (this.Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -4509,7 +4350,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -4560,15 +4401,16 @@ internal TableResourcesOperations (CosmosDBManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { + ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -4578,6 +4420,10 @@ internal TableResourcesOperations (CosmosDBManagementClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -4590,7 +4436,7 @@ internal TableResourcesOperations (CosmosDBManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -4598,9 +4444,27 @@ internal TableResourcesOperations (CosmosDBManagementClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } catch (Newtonsoft.Json.JsonException ex) { @@ -4621,6 +4485,537 @@ internal TableResourcesOperations (CosmosDBManagementClient client) + } + /// + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListTableRoleAssignmentsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleAssignmentsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListTableRoleDefinitionsNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTableRoleDefinitionsNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Lists the Tables under an existing Azure Cosmos DB database account. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListTablesNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListTablesNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperationsExtensions.cs b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperationsExtensions.cs index 38eddcfb4a6f..256db67710d9 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperationsExtensions.cs +++ b/src/CosmosDB/CosmosDB.Management.Sdk/Generated/TableResourcesOperationsExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.CosmosDB public static partial class TableResourcesOperationsExtensions { /// - /// Lists the Tables under an existing Azure Cosmos DB database account. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The operations group for this extension method. @@ -24,13 +24,13 @@ public static partial class TableResourcesOperationsExtensions /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListTables(this ITableResourcesOperations operations, string resourceGroupName, string accountName) + public static Microsoft.Rest.Azure.IPage ListTableRoleAssignments(this ITableResourcesOperations operations, string resourceGroupName, string accountName) { - return ((ITableResourcesOperations)operations).ListTablesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).ListTableRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// - /// Lists the Tables under an existing Azure Cosmos DB database account. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The operations group for this extension method. @@ -44,16 +44,16 @@ public static System.Collections.Generic.IEnumerable ListTables /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListTablesAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListTableRoleAssignmentsAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListTablesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListTableRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the Tables under an existing Azure Cosmos DB database account with the - /// provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -64,17 +64,17 @@ public static System.Collections.Generic.IEnumerable ListTables /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - public static TableGetResults GetTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static TableRoleAssignmentResource GetTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ITableResourcesOperations)operations).GetTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).GetTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Gets the Tables under an existing Azure Cosmos DB database account with the - /// provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Assignment with the given Id. /// /// /// The operations group for this extension method. @@ -85,21 +85,21 @@ public static TableGetResults GetTable(this ITableResourcesOperations operations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// /// The operations group for this extension method. @@ -110,16 +110,16 @@ public static TableGetResults GetTable(this ITableResourcesOperations operations /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - public static TableGetResults CreateUpdateTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters) + public static TableRoleAssignmentResource CreateUpdateTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters) { - return ((ITableResourcesOperations)operations).CreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).CreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Assignment. /// /// /// The operations group for this extension method. @@ -130,21 +130,21 @@ public static TableGetResults CreateUpdateTable(this ITableResourcesOperations o /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The operations group for this extension method. @@ -155,16 +155,16 @@ public static TableGetResults CreateUpdateTable(this ITableResourcesOperations o /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// - public static TableResourcesDeleteTableHeaders DeleteTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static TableResourcesDeleteTableRoleAssignmentHeaders DeleteTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ITableResourcesOperations)operations).DeleteTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).DeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Deletes an existing Azure Cosmos DB Table Role Assignment. /// /// /// The operations group for this extension method. @@ -175,22 +175,21 @@ public static TableResourcesDeleteTableHeaders DeleteTable(this ITableResourcesO /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Assignment. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// - /// Gets the RUs per second of the Table under an existing Azure Cosmos DB - /// database account with the provided name. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// /// The operations group for this extension method. @@ -201,17 +200,57 @@ public static TableResourcesDeleteTableHeaders DeleteTable(this ITableResourcesO /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + public static Microsoft.Rest.Azure.IPage ListTableRoleDefinitions(this ITableResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((ITableResourcesOperations)operations).ListTableRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// + /// + /// The operations group for this extension method. /// - public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListTableRoleDefinitionsAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - return ((ITableResourcesOperations)operations).GetTableThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + using (var _result = await operations.ListTableRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Definition with the given Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static TableRoleDefinitionResource GetTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ITableResourcesOperations)operations).GetTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); } /// - /// Gets the RUs per second of the Table under an existing Azure Cosmos DB - /// database account with the provided name. + /// Retrieves the properties of an existing Azure Cosmos DB Table Role + /// Definition with the given Id. /// /// /// The operations group for this extension method. @@ -222,21 +261,21 @@ public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourc /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -247,16 +286,16 @@ public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourc /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// - public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static TableRoleDefinitionResource CreateUpdateTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters) { - return ((ITableResourcesOperations)operations).UpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).CreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -267,21 +306,106 @@ public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableReso /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + public static TableResourcesDeleteTableRoleDefinitionHeaders DeleteTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + { + return ((ITableResourcesOperations)operations).DeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The GUID for the Role Definition. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Lists the Tables under an existing Azure Cosmos DB database 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 Microsoft.Rest.Azure.IPage ListTables(this ITableResourcesOperations operations, string resourceGroupName, string accountName) + { + return ((ITableResourcesOperations)operations).ListTablesAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Lists the Tables under an existing Azure Cosmos DB database 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 System.Threading.Tasks.Task> ListTablesAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListTablesWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Gets the Tables under an existing Azure Cosmos DB database account with the + /// provided name. /// /// /// The operations group for this extension method. @@ -295,13 +419,14 @@ public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableReso /// /// Cosmos DB table name. /// - public static ThroughputSettingsGetResults MigrateTableToAutoscale(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static TableGetResults GetTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).MigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).GetTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Gets the Tables under an existing Azure Cosmos DB database account with the + /// provided name. /// /// /// The operations group for this extension method. @@ -318,15 +443,15 @@ public static ThroughputSettingsGetResults MigrateTableToAutoscale(this ITableRe /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateTableToAutoscaleAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Create or update an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -340,13 +465,13 @@ public static ThroughputSettingsGetResults MigrateTableToAutoscale(this ITableRe /// /// Cosmos DB table name. /// - public static ThroughputSettingsGetResults MigrateTableToManualThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static TableGetResults CreateUpdateTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters) { - return ((ITableResourcesOperations)operations).MigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).CreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Create or update an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -363,15 +488,15 @@ public static ThroughputSettingsGetResults MigrateTableToManualThroughput(this I /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MigrateTableToManualThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateUpdateTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.MigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a table. + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The operations group for this extension method. @@ -385,13 +510,13 @@ public static ThroughputSettingsGetResults MigrateTableToManualThroughput(this I /// /// Cosmos DB table name. /// - public static BackupInformation RetrieveContinuousBackupInformation(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location) + public static TableResourcesDeleteTableHeaders DeleteTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).DeleteTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a table. + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The operations group for this extension method. @@ -408,16 +533,15 @@ public static BackupInformation RetrieveContinuousBackupInformation(this ITableR /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Definition with the given Id. + /// Retrieves continuous backup information for a table. /// /// /// The operations group for this extension method. @@ -428,17 +552,16 @@ public static BackupInformation RetrieveContinuousBackupInformation(this ITableR /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - public static TableRoleDefinitionResource GetTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + public static BackupInformation RetrieveContinuousBackupInformation(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location) { - return ((ITableResourcesOperations)operations).GetTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).RetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Definition with the given Id. + /// Retrieves continuous backup information for a table. /// /// /// The operations group for this extension method. @@ -449,21 +572,22 @@ public static TableRoleDefinitionResource GetTableRoleDefinition(this ITableReso /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RetrieveContinuousBackupInformationAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Gets the RUs per second of the Table under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The operations group for this extension method. @@ -474,16 +598,17 @@ public static TableRoleDefinitionResource GetTableRoleDefinition(this ITableReso /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - public static TableRoleDefinitionResource CreateUpdateTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters) + public static ThroughputSettingsGetResults GetTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).CreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).GetTableThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Gets the RUs per second of the Table under an existing Azure Cosmos DB + /// database account with the provided name. /// /// /// The operations group for this extension method. @@ -494,21 +619,21 @@ public static TableRoleDefinitionResource CreateUpdateTableRoleDefinition(this I /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -519,16 +644,16 @@ public static TableRoleDefinitionResource CreateUpdateTableRoleDefinition(this I /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - public static TableResourcesDeleteTableRoleDefinitionHeaders DeleteTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + public static ThroughputSettingsGetResults UpdateTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ITableResourcesOperations)operations).DeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).UpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -539,21 +664,21 @@ public static TableResourcesDeleteTableRoleDefinitionHeaders DeleteTableRoleDefi /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The operations group for this extension method. @@ -564,13 +689,16 @@ public static TableResourcesDeleteTableRoleDefinitionHeaders DeleteTableRoleDefi /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListTableRoleDefinitions(this ITableResourcesOperations operations, string resourceGroupName, string accountName) + /// + /// Cosmos DB table name. + /// + public static ThroughputSettingsGetResults MigrateTableToAutoscale(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).ListTableRoleDefinitionsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).MigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The operations group for this extension method. @@ -581,19 +709,21 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// + /// + /// Cosmos DB table name. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListTableRoleDefinitionsAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateTableToAutoscaleAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListTableRoleDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Assignment with the given Id. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The operations group for this extension method. @@ -604,17 +734,16 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// - public static TableRoleAssignmentResource GetTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + public static ThroughputSettingsGetResults MigrateTableToManualThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).GetTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).MigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Retrieves the properties of an existing Azure Cosmos DB Table Role - /// Assignment with the given Id. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The operations group for this extension method. @@ -625,15 +754,15 @@ public static TableRoleAssignmentResource GetTableRoleAssignment(this ITableReso /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Assignment. + /// + /// Cosmos DB table name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task MigrateTableToManualThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -653,9 +782,9 @@ public static TableRoleAssignmentResource GetTableRoleAssignment(this ITableReso /// /// The GUID for the Role Assignment. /// - public static TableRoleAssignmentResource CreateUpdateTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters) + public static TableRoleAssignmentResource BeginCreateUpdateTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters) { - return ((ITableResourcesOperations)operations).CreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters).GetAwaiter().GetResult(); } /// @@ -676,9 +805,9 @@ public static TableRoleAssignmentResource CreateUpdateTableRoleAssignment(this I /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateUpdateTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -698,9 +827,9 @@ public static TableRoleAssignmentResource CreateUpdateTableRoleAssignment(this I /// /// The GUID for the Role Assignment. /// - public static TableResourcesDeleteTableRoleAssignmentHeaders DeleteTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + public static TableResourcesDeleteTableRoleAssignmentHeaders BeginDeleteTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) { - return ((ITableResourcesOperations)operations).DeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); } /// @@ -721,15 +850,15 @@ public static TableResourcesDeleteTableRoleAssignmentHeaders DeleteTableRoleAssi /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) { return _result.Headers; } } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -740,13 +869,16 @@ public static TableResourcesDeleteTableRoleAssignmentHeaders DeleteTableRoleAssi /// /// Cosmos DB database account name. /// - public static System.Collections.Generic.IEnumerable ListTableRoleAssignments(this ITableResourcesOperations operations, string resourceGroupName, string accountName) + /// + /// The GUID for the Role Definition. + /// + public static TableRoleDefinitionResource BeginCreateUpdateTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters) { - return ((ITableResourcesOperations)operations).ListTableRoleAssignmentsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters).GetAwaiter().GetResult(); } /// - /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. + /// Creates or updates an Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -757,18 +889,21 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// + /// + /// The GUID for the Role Definition. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListTableRoleAssignmentsAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListTableRoleAssignmentsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create or update an Azure Cosmos DB Table + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -779,16 +914,16 @@ public static System.Collections.Generic.IEnumerable /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// - public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters) + public static TableResourcesDeleteTableRoleDefinitionHeaders BeginDeleteTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) { - return ((ITableResourcesOperations)operations).BeginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); } /// - /// Create or update an Azure Cosmos DB Table + /// Deletes an existing Azure Cosmos DB Table Role Definition. /// /// /// The operations group for this extension method. @@ -799,21 +934,21 @@ public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperati /// /// Cosmos DB database account name. /// - /// - /// Cosmos DB table name. + /// + /// The GUID for the Role Definition. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Create or update an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -827,13 +962,13 @@ public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperati /// /// Cosmos DB table name. /// - public static TableResourcesDeleteTableHeaders BeginDeleteTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static TableGetResults BeginCreateUpdateTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters) { - return ((ITableResourcesOperations)operations).BeginDeleteTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Table. + /// Create or update an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -850,15 +985,15 @@ public static TableResourcesDeleteTableHeaders BeginDeleteTable(this ITableResou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateUpdateTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, TableCreateUpdateParameters createUpdateTableParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateUpdateTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The operations group for this extension method. @@ -872,13 +1007,13 @@ public static TableResourcesDeleteTableHeaders BeginDeleteTable(this ITableResou /// /// Cosmos DB table name. /// - public static ThroughputSettingsGetResults BeginUpdateTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) + public static TableResourcesDeleteTableHeaders BeginDeleteTable(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).BeginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginDeleteTableAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Update RUs per second of an Azure Cosmos DB Table + /// Deletes an existing Azure Cosmos DB Table. /// /// /// The operations group for this extension method. @@ -895,15 +1030,15 @@ public static ThroughputSettingsGetResults BeginUpdateTableThroughput(this ITabl /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginUpdateTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteTableAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginUpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteTableWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { - return _result.Body; + return _result.Headers; } } /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Retrieves continuous backup information for a table. /// /// /// The operations group for this extension method. @@ -917,13 +1052,13 @@ public static ThroughputSettingsGetResults BeginUpdateTableThroughput(this ITabl /// /// Cosmos DB table name. /// - public static ThroughputSettingsGetResults BeginMigrateTableToAutoscale(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static BackupInformation BeginRetrieveContinuousBackupInformation(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location) { - return ((ITableResourcesOperations)operations).BeginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale + /// Retrieves continuous backup information for a table. /// /// /// The operations group for this extension method. @@ -940,15 +1075,15 @@ public static ThroughputSettingsGetResults BeginMigrateTableToAutoscale(this ITa /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateTableToAutoscaleAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -962,13 +1097,13 @@ public static ThroughputSettingsGetResults BeginMigrateTableToAutoscale(this ITa /// /// Cosmos DB table name. /// - public static ThroughputSettingsGetResults BeginMigrateTableToManualThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) + public static ThroughputSettingsGetResults BeginUpdateTableThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return ((ITableResourcesOperations)operations).BeginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters).GetAwaiter().GetResult(); } /// - /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput + /// Update RUs per second of an Azure Cosmos DB Table /// /// /// The operations group for this extension method. @@ -985,15 +1120,15 @@ public static ThroughputSettingsGetResults BeginMigrateTableToManualThroughput(t /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMigrateTableToManualThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginUpdateTableThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginMigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateTableThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Retrieves continuous backup information for a table. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The operations group for this extension method. @@ -1007,13 +1142,13 @@ public static ThroughputSettingsGetResults BeginMigrateTableToManualThroughput(t /// /// Cosmos DB table name. /// - public static BackupInformation BeginRetrieveContinuousBackupInformation(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location) + public static ThroughputSettingsGetResults BeginMigrateTableToAutoscale(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).BeginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Retrieves continuous backup information for a table. + /// Migrate an Azure Cosmos DB Table from manual throughput to autoscale /// /// /// The operations group for this extension method. @@ -1030,15 +1165,15 @@ public static BackupInformation BeginRetrieveContinuousBackupInformation(this IT /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRetrieveContinuousBackupInformationAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, ContinuousBackupRestoreLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateTableToAutoscaleAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(resourceGroupName, accountName, tableName, location, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateTableToAutoscaleWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The operations group for this extension method. @@ -1049,16 +1184,16 @@ public static BackupInformation BeginRetrieveContinuousBackupInformation(this IT /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// - public static TableRoleDefinitionResource BeginCreateUpdateTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters) + public static ThroughputSettingsGetResults BeginMigrateTableToManualThroughput(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName) { - return ((ITableResourcesOperations)operations).BeginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).BeginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB Table Role Definition. + /// Migrate an Azure Cosmos DB Table from autoscale to manual throughput /// /// /// The operations group for this extension method. @@ -1069,152 +1204,116 @@ public static TableRoleDefinitionResource BeginCreateUpdateTableRoleDefinition(t /// /// Cosmos DB database account name. /// - /// - /// The GUID for the Role Definition. + /// + /// Cosmos DB table name. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, TableRoleDefinitionResource createUpdateTableRoleDefinitionParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMigrateTableToManualThroughputAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string tableName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMigrateTableToManualThroughputWithHttpMessagesAsync(resourceGroupName, accountName, tableName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The GUID for the Role Definition. + /// + /// The NextLink from the previous successful call to List operation. /// - public static TableResourcesDeleteTableRoleDefinitionHeaders BeginDeleteTableRoleDefinition(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId) + public static Microsoft.Rest.Azure.IPage ListTableRoleAssignmentsNext(this ITableResourcesOperations operations, string nextPageLink) { - return ((ITableResourcesOperations)operations).BeginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).ListTableRoleAssignmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Table Role Definition. + /// Retrieves the list of all Azure Cosmos DB Table Role Assignments. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The GUID for the Role Definition. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteTableRoleDefinitionAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleDefinitionId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListTableRoleAssignmentsNextAsync(this ITableResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteTableRoleDefinitionWithHttpMessagesAsync(resourceGroupName, accountName, roleDefinitionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListTableRoleAssignmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// - public static TableRoleAssignmentResource BeginCreateUpdateTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters) + public static Microsoft.Rest.Azure.IPage ListTableRoleDefinitionsNext(this ITableResourcesOperations operations, string nextPageLink) { - return ((ITableResourcesOperations)operations).BeginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).ListTableRoleDefinitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Creates or updates an Azure Cosmos DB Table Role Assignment. + /// Retrieves the list of all Azure Cosmos DB Table Role Definitions. /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Cosmos DB database account name. - /// - /// - /// The GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginCreateUpdateTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, TableRoleAssignmentResource createUpdateTableRoleAssignmentParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListTableRoleDefinitionsNextAsync(this ITableResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginCreateUpdateTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListTableRoleDefinitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Lists the Tables under an existing Azure Cosmos DB database 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 GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// - public static TableResourcesDeleteTableRoleAssignmentHeaders BeginDeleteTableRoleAssignment(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId) + public static Microsoft.Rest.Azure.IPage ListTablesNext(this ITableResourcesOperations operations, string nextPageLink) { - return ((ITableResourcesOperations)operations).BeginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).GetAwaiter().GetResult(); + return ((ITableResourcesOperations)operations).ListTablesNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Deletes an existing Azure Cosmos DB Table Role Assignment. + /// Lists the Tables under an existing Azure Cosmos DB database 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 GUID for the Role Assignment. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteTableRoleAssignmentAsync(this ITableResourcesOperations operations, string resourceGroupName, string accountName, string roleAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListTablesNextAsync(this ITableResourcesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginDeleteTableRoleAssignmentWithHttpMessagesAsync(resourceGroupName, accountName, roleAssignmentId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListTablesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return _result.Headers; + return _result.Body; } } } diff --git a/src/CosmosDB/CosmosDB.Management.Sdk/README.md b/src/CosmosDB/CosmosDB.Management.Sdk/README.md index 18ec603ffe70..8c1d2e79ec26 100644 --- a/src/CosmosDB/CosmosDB.Management.Sdk/README.md +++ b/src/CosmosDB/CosmosDB.Management.Sdk/README.md @@ -26,21 +26,11 @@ title: CosmosDBManagementClient ### ``` yaml -commit: b99dfe6606f232f454660bf361bc32c0dfade9fb -apiversion: "2025-10-15" +commit: 2254f7847ecb3e3c5a62ba1c8b32ca0e4f0c29b4 +apiversion: "2026-03-15" previewapiversion: "2024-12-01-preview" input-file: - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/cosmos-db.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/managedCassandra.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/mongorbac.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/notebook.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/privateEndpointConnection.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/privateLinkResources.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/rbac.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/restorable.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/services.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/fleet.json - - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/preview/$(previewapiversion)/tablerbac.json + - https://github.com/Azure/azure-rest-api-specs/tree/$(commit)/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/$(apiversion)/openapi.json output-folder: Generated diff --git a/src/CosmosDB/CosmosDB/Models/DatabaseAccount/PSDatabaseAccountGetResults.cs b/src/CosmosDB/CosmosDB/Models/DatabaseAccount/PSDatabaseAccountGetResults.cs index 41b6d2729465..8df20c957710 100644 --- a/src/CosmosDB/CosmosDB/Models/DatabaseAccount/PSDatabaseAccountGetResults.cs +++ b/src/CosmosDB/CosmosDB/Models/DatabaseAccount/PSDatabaseAccountGetResults.cs @@ -149,7 +149,7 @@ public PSDatabaseAccountGetResults(DatabaseAccountGetResults databaseAccountGetR // Summary: // Gets the offer type for the Cosmos DB database account. Default value: Standard. // Possible values include: 'Standard' - public DatabaseAccountOfferType? DatabaseAccountOfferType { get; } + public DatabaseAccountGetPropertiesDatabaseAccountOfferType? DatabaseAccountOfferType { get; } // // Summary: // Gets the connection endpoint for the Cosmos DB database account. diff --git a/src/CosmosDB/CosmosDB/Models/Table/PSTableRoleDefinitionGetResults.cs b/src/CosmosDB/CosmosDB/Models/Table/PSTableRoleDefinitionGetResults.cs index ca2a809622f5..ad9b393ba194 100644 --- a/src/CosmosDB/CosmosDB/Models/Table/PSTableRoleDefinitionGetResults.cs +++ b/src/CosmosDB/CosmosDB/Models/Table/PSTableRoleDefinitionGetResults.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +36,7 @@ public PSTableRoleDefinitionGetResults(TableRoleDefinitionResource tableRoleDefi RoleName = tableRoleDefinitionGetResults.RoleName; Id = tableRoleDefinitionGetResults.Id; Type = tableRoleDefinitionGetResults.PropertiesType.ToString(); - Permissions = new List(tableRoleDefinitionGetResults.Permissions.ToList()); + Permissions = new List(tableRoleDefinitionGetResults.Permissions.ToList()); AssignableScopes = new List(tableRoleDefinitionGetResults.AssignableScopes); } @@ -69,6 +69,6 @@ public PSTableRoleDefinitionGetResults(TableRoleDefinitionResource tableRoleDefi /// [Ps1Xml(Label = "Permissions.DataActions", Target = ViewControl.List, ScriptBlock = "$_.Permissions.DataActions")] [Ps1Xml(Label = "Permissions.NotDataActions", Target = ViewControl.List, ScriptBlock = "$_.Permissions.NotDataActions")] - public IList Permissions { get; set; } + public IList Permissions { get; set; } } -} \ No newline at end of file +} diff --git a/src/CosmosDB/CosmosDB/SQL/NewAzCosmosDBSqlRoleDefinition.cs b/src/CosmosDB/CosmosDB/SQL/NewAzCosmosDBSqlRoleDefinition.cs index 4d4321a6a3c5..a9995bdc8f2d 100644 --- a/src/CosmosDB/CosmosDB/SQL/NewAzCosmosDBSqlRoleDefinition.cs +++ b/src/CosmosDB/CosmosDB/SQL/NewAzCosmosDBSqlRoleDefinition.cs @@ -98,7 +98,7 @@ public override void ExecuteCmdlet() } else { - permissions = new List(Permission.Select(p => new Permission(p.DataActions))); + permissions = new List(Permission.Select(p => new Permission(dataActions: p.DataActions))); } Id = string.IsNullOrWhiteSpace(Id) ? Guid.NewGuid().ToString() : RoleHelper.ParseToRoleDefinitionId(Id); diff --git a/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlRoleDefinition.cs b/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlRoleDefinition.cs index dfd2aabea8ca..de4b7dd5c06f 100644 --- a/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlRoleDefinition.cs +++ b/src/CosmosDB/CosmosDB/SQL/UpdateAzCosmosDBSqlRoleDefinition.cs @@ -118,7 +118,7 @@ public override void ExecuteCmdlet() } else if (Permission != null) { - permissions = new List(Permission.Select(p => new Permission(p.DataActions))); + permissions = new List(Permission.Select(p => new Permission(dataActions: p.DataActions))); } Id = RoleHelper.ParseToRoleDefinitionId(Id); diff --git a/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleAssignment.cs b/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleAssignment.cs index 93eea4f50259..e1d308197056 100644 --- a/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleAssignment.cs +++ b/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleAssignment.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,7 +95,7 @@ public override void ExecuteCmdlet() { readTableRoleAssignmentGetResults = CosmosDBManagementClient.TableResources.GetTableRoleAssignment(ResourceGroupName, AccountName, Id); } - catch (ErrorResponseAutoGeneratedException e) + catch (Microsoft.Rest.Azure.CloudException e) { if (e.Response.StatusCode != HttpStatusCode.NotFound) { @@ -125,3 +125,4 @@ public override void ExecuteCmdlet() } } } + diff --git a/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleDefinition.cs b/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleDefinition.cs index f69dc03ed61b..0c921c10605c 100644 --- a/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleDefinition.cs +++ b/src/CosmosDB/CosmosDB/Table/NewAzCosmosDBTableRoleDefinition.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -84,13 +84,13 @@ public override void ExecuteCmdlet() AccountName = resourceIdentifier.ResourceName; } - List permissions; + List permissions; if (ParameterSetName.Equals(FieldsDataActionsParameterSet, StringComparison.Ordinal) || ParameterSetName.Equals(ParentObjectDataActionsParameterSet, StringComparison.Ordinal)) { - permissions = new List + permissions = new List { - new PermissionAutoGenerated + new Permission { DataActions = DataAction } @@ -98,7 +98,7 @@ public override void ExecuteCmdlet() } else { - permissions = new List(Permission.Select(p => new PermissionAutoGenerated(dataActions: p.DataActions))); + permissions = new List(Permission.Select(p => new Permission(dataActions: p.DataActions))); } Id = string.IsNullOrWhiteSpace(Id) ? Guid.NewGuid().ToString() : TableRoleHelper.ParseToRoleDefinitionId(Id); @@ -108,7 +108,7 @@ public override void ExecuteCmdlet() { readTableRoleDefinitionGetResults = CosmosDBManagementClient.TableResources.GetTableRoleDefinition(ResourceGroupName, AccountName, Id); } - catch (ErrorResponseAutoGeneratedException e) + catch (Microsoft.Rest.Azure.CloudException e) { if (e.Response.StatusCode != HttpStatusCode.NotFound) { @@ -142,3 +142,5 @@ public override void ExecuteCmdlet() } } } + + diff --git a/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleAssignment.cs b/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleAssignment.cs index ae1980384e65..06709d655cb3 100644 --- a/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleAssignment.cs +++ b/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleAssignment.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -116,7 +116,7 @@ public override void ExecuteCmdlet() { readTableRoleAssignmentGetResults = CosmosDBManagementClient.TableResources.GetTableRoleAssignment(ResourceGroupName, AccountName, Id); } - catch (ErrorResponseAutoGeneratedException e) + catch (Microsoft.Rest.Azure.CloudException e) { if (e.Response.StatusCode == System.Net.HttpStatusCode.NotFound) { @@ -145,3 +145,4 @@ public override void ExecuteCmdlet() } } } + diff --git a/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleDefinition.cs b/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleDefinition.cs index f951fcdfe74a..f2ea771b3ed7 100644 --- a/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleDefinition.cs +++ b/src/CosmosDB/CosmosDB/Table/UpdateAzCosmosDBTableRoleDefinition.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -81,7 +81,7 @@ public class UpdateAzCosmosDBTableRoleDefinition : AzureCosmosDBCmdletBase public override void ExecuteCmdlet() { - List permissions = null; + List permissions = null; if (ParameterSetName.Equals(ParentObjectParameterSet, StringComparison.Ordinal)) { ResourceIdentifier resourceIdentifier = new ResourceIdentifier(ParentObject.Id); @@ -94,7 +94,7 @@ public override void ExecuteCmdlet() Type = InputObject.Type; AssignableScope = new List(InputObject.AssignableScopes); Id = InputObject.Id; - permissions = new List(InputObject.Permissions); + permissions = new List(InputObject.Permissions); ResourceIdentifier resourceIdentifier = new ResourceIdentifier(InputObject.Id); ResourceGroupName = resourceIdentifier.ResourceGroupName; @@ -108,9 +108,9 @@ public override void ExecuteCmdlet() if (DataAction != null) { - permissions = new List + permissions = new List { - new PermissionAutoGenerated + new Permission { DataActions = DataAction } @@ -118,7 +118,7 @@ public override void ExecuteCmdlet() } else if (Permission != null) { - permissions = new List(Permission.Select(p => new PermissionAutoGenerated(dataActions: p.DataActions))); + permissions = new List(Permission.Select(p => new Permission(dataActions: p.DataActions))); } Id = TableRoleHelper.ParseToRoleDefinitionId(Id); @@ -128,7 +128,7 @@ public override void ExecuteCmdlet() { readTableRoleDefinitionGetResults = CosmosDBManagementClient.TableResources.GetTableRoleDefinition(ResourceGroupName, AccountName, Id); } - catch (ErrorResponseAutoGeneratedException e) + catch (Microsoft.Rest.Azure.CloudException e) { if (e.Response.StatusCode == System.Net.HttpStatusCode.NotFound) { @@ -161,3 +161,5 @@ public override void ExecuteCmdlet() } } } + +