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