diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersCreateUpdateOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersCreateUpdateOperation.cs
new file mode 100644
index 000000000000..bf0ddecd84b5
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersCreateUpdateOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH.
+ public partial class CassandraClustersCreateUpdateOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraClustersCreateUpdateOperation for mocking.
+ protected CassandraClustersCreateUpdateOperation()
+ {
+ }
+
+ internal CassandraClustersCreateUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraClustersCreateUpdateOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ClusterResource Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ClusterResource.DeserializeClusterResource(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ClusterResource.DeserializeClusterResource(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersDeleteOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersDeleteOperation.cs
new file mode 100644
index 000000000000..b9a749fcece3
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersDeleteOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Deletes a managed Cassandra cluster.
+ public partial class CassandraClustersDeleteOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraClustersDeleteOperation for mocking.
+ protected CassandraClustersDeleteOperation()
+ {
+ }
+
+ internal CassandraClustersDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraClustersDeleteOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersFetchNodeStatusOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersFetchNodeStatusOperation.cs
new file mode 100644
index 000000000000..5044866b7b0f
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersFetchNodeStatusOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Request the status of all nodes in the cluster (as returned by 'nodetool status').
+ public partial class CassandraClustersFetchNodeStatusOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraClustersFetchNodeStatusOperation for mocking.
+ protected CassandraClustersFetchNodeStatusOperation()
+ {
+ }
+
+ internal CassandraClustersFetchNodeStatusOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraClustersFetchNodeStatusOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ClusterNodeStatus Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ClusterNodeStatus IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ClusterNodeStatus.DeserializeClusterNodeStatus(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ClusterNodeStatus.DeserializeClusterNodeStatus(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersOperations.cs
new file mode 100644
index 000000000000..22f85eb6f41d
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersOperations.cs
@@ -0,0 +1,621 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// The CassandraClusters service client.
+ public partial class CassandraClustersOperations
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal CassandraClustersRestOperations RestClient { get; }
+
+ /// Initializes a new instance of CassandraClustersOperations for mocking.
+ protected CassandraClustersOperations()
+ {
+ }
+
+ /// Initializes a new instance of CassandraClustersOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ internal CassandraClustersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ RestClient = new CassandraClustersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Get the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.Get");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetAsync(resourceGroupName, clusterName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ public virtual Response Get(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.Get");
+ scope.Start();
+ try
+ {
+ return RestClient.Get(resourceGroupName, clusterName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get the properties of an individual backup of this cluster that is available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Id of a restorable backup of a Cassandra cluster.
+ /// The cancellation token to use.
+ public virtual async Task> GetBackupAsync(string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.GetBackup");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetBackupAsync(resourceGroupName, clusterName, backupId, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get the properties of an individual backup of this cluster that is available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Id of a restorable backup of a Cassandra cluster.
+ /// The cancellation token to use.
+ public virtual Response GetBackup(string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.GetBackup");
+ scope.Start();
+ try
+ {
+ return RestClient.GetBackup(resourceGroupName, clusterName, backupId, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List all managed Cassandra clusters in this subscription.
+ /// The cancellation token to use.
+ public virtual AsyncPageable ListBySubscriptionAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListBySubscription");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListBySubscriptionAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// List all managed Cassandra clusters in this subscription.
+ /// The cancellation token to use.
+ public virtual Pageable ListBySubscription(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListBySubscription");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListBySubscription(cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// List all managed Cassandra clusters in this resource group.
+ /// The name of the resource group. The name is case insensitive.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual AsyncPageable ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListByResourceGroup");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// List all managed Cassandra clusters in this resource group.
+ /// The name of the resource group. The name is case insensitive.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual Pageable ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListByResourceGroup");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// List the backups of this cluster that are available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual AsyncPageable ListBackupsAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListBackups");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListBackupsAsync(resourceGroupName, clusterName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// List the backups of this cluster that are available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual Pageable ListBackups(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.ListBackups");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListBackups(resourceGroupName, clusterName, cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Deletes a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual async Task StartDeleteAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartDelete");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.DeleteAsync(resourceGroupName, clusterName, cancellationToken).ConfigureAwait(false);
+ return new CassandraClustersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, clusterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual CassandraClustersDeleteOperation StartDelete(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartDelete");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Delete(resourceGroupName, clusterName, cancellationToken);
+ return new CassandraClustersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, clusterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// The properties specifying the desired state of the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartCreateUpdateAsync(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartCreateUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.CreateUpdateAsync(resourceGroupName, clusterName, body, cancellationToken).ConfigureAwait(false);
+ return new CassandraClustersCreateUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// The properties specifying the desired state of the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual CassandraClustersCreateUpdateOperation StartCreateUpdate(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartCreateUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.CreateUpdate(resourceGroupName, clusterName, body, cancellationToken);
+ return new CassandraClustersCreateUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Updates some of the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Parameters to provide for specifying the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartUpdateAsync(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.UpdateAsync(resourceGroupName, clusterName, body, cancellationToken).ConfigureAwait(false);
+ return new CassandraClustersUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Updates some of the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Parameters to provide for specifying the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual CassandraClustersUpdateOperation StartUpdate(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Update(resourceGroupName, clusterName, body, cancellationToken);
+ return new CassandraClustersUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Request that repair begin on this cluster as soon as possible.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Specification of what keyspaces and tables to run repair on.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartRequestRepairAsync(string resourceGroupName, string clusterName, RepairPostBody body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartRequestRepair");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.RequestRepairAsync(resourceGroupName, clusterName, body, cancellationToken).ConfigureAwait(false);
+ return new CassandraClustersRequestRepairOperation(_clientDiagnostics, _pipeline, RestClient.CreateRequestRepairRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Request that repair begin on this cluster as soon as possible.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Specification of what keyspaces and tables to run repair on.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual CassandraClustersRequestRepairOperation StartRequestRepair(string resourceGroupName, string clusterName, RepairPostBody body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartRequestRepair");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.RequestRepair(resourceGroupName, clusterName, body, cancellationToken);
+ return new CassandraClustersRequestRepairOperation(_clientDiagnostics, _pipeline, RestClient.CreateRequestRepairRequest(resourceGroupName, clusterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Request the status of all nodes in the cluster (as returned by 'nodetool status').
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual async Task StartFetchNodeStatusAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartFetchNodeStatus");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.FetchNodeStatusAsync(resourceGroupName, clusterName, cancellationToken).ConfigureAwait(false);
+ return new CassandraClustersFetchNodeStatusOperation(_clientDiagnostics, _pipeline, RestClient.CreateFetchNodeStatusRequest(resourceGroupName, clusterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Request the status of all nodes in the cluster (as returned by 'nodetool status').
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual CassandraClustersFetchNodeStatusOperation StartFetchNodeStatus(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraClustersOperations.StartFetchNodeStatus");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.FetchNodeStatus(resourceGroupName, clusterName, cancellationToken);
+ return new CassandraClustersFetchNodeStatusOperation(_clientDiagnostics, _pipeline, RestClient.CreateFetchNodeStatusRequest(resourceGroupName, clusterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRequestRepairOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRequestRepairOperation.cs
new file mode 100644
index 000000000000..d6fb831402ff
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRequestRepairOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Request that repair begin on this cluster as soon as possible.
+ public partial class CassandraClustersRequestRepairOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraClustersRequestRepairOperation for mocking.
+ protected CassandraClustersRequestRepairOperation()
+ {
+ }
+
+ internal CassandraClustersRequestRepairOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraClustersRequestRepairOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRestOperations.cs
new file mode 100644
index 000000000000..9fc1cad67b22
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersRestOperations.cs
@@ -0,0 +1,860 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ internal partial class CassandraClustersRestOperations
+ {
+ private string subscriptionId;
+ private Uri endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of CassandraClustersRestOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ /// or is null.
+ public CassandraClustersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ if (subscriptionId == null)
+ {
+ throw new ArgumentNullException(nameof(subscriptionId));
+ }
+ endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateListBySubscriptionRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// List all managed Cassandra clusters in this subscription.
+ /// The cancellation token to use.
+ public async Task> ListBySubscriptionAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateListBySubscriptionRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListClusters value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = ListClusters.DeserializeListClusters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List all managed Cassandra clusters in this subscription.
+ /// The cancellation token to use.
+ public Response ListBySubscription(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateListBySubscriptionRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListClusters value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = ListClusters.DeserializeListClusters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// List all managed Cassandra clusters in this resource group.
+ /// The name of the resource group. The name is case insensitive.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> ListByResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+
+ using var message = CreateListByResourceGroupRequest(resourceGroupName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListClusters value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = ListClusters.DeserializeListClusters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List all managed Cassandra clusters in this resource group.
+ /// The name of the resource group. The name is case insensitive.
+ /// The cancellation token to use.
+ /// is null.
+ public Response ListByResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+
+ using var message = CreateListByResourceGroupRequest(resourceGroupName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListClusters value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = ListClusters.DeserializeListClusters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRequest(string resourceGroupName, string clusterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Get the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task> GetAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateGetRequest(resourceGroupName, clusterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ClusterResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = ClusterResource.DeserializeClusterResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response Get(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateGetRequest(resourceGroupName, clusterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ClusterResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = ClusterResource.DeserializeClusterResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string clusterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Deletes a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task DeleteAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateDeleteRequest(resourceGroupName, clusterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response Delete(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateDeleteRequest(resourceGroupName, clusterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateUpdateRequest(string resourceGroupName, string clusterName, ClusterResource body)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(body);
+ request.Content = content;
+ return message;
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// The properties specifying the desired state of the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task CreateUpdateAsync(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateCreateUpdateRequest(resourceGroupName, clusterName, body);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// The properties specifying the desired state of the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response CreateUpdate(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateCreateUpdateRequest(resourceGroupName, clusterName, body);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateUpdateRequest(string resourceGroupName, string clusterName, ClusterResource body)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Patch;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(body);
+ request.Content = content;
+ return message;
+ }
+
+ /// Updates some of the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Parameters to provide for specifying the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task UpdateAsync(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateUpdateRequest(resourceGroupName, clusterName, body);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Updates some of the properties of a managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Parameters to provide for specifying the managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response Update(string resourceGroupName, string clusterName, ClusterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateUpdateRequest(resourceGroupName, clusterName, body);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateRequestRepairRequest(string resourceGroupName, string clusterName, RepairPostBody body)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/repair", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(body);
+ request.Content = content;
+ return message;
+ }
+
+ /// Request that repair begin on this cluster as soon as possible.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Specification of what keyspaces and tables to run repair on.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task RequestRepairAsync(string resourceGroupName, string clusterName, RepairPostBody body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateRequestRepairRequest(resourceGroupName, clusterName, body);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Request that repair begin on this cluster as soon as possible.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Specification of what keyspaces and tables to run repair on.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response RequestRepair(string resourceGroupName, string clusterName, RepairPostBody body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateRequestRepairRequest(resourceGroupName, clusterName, body);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateFetchNodeStatusRequest(string resourceGroupName, string clusterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/fetchNodeStatus", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Request the status of all nodes in the cluster (as returned by 'nodetool status').
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task FetchNodeStatusAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateFetchNodeStatusRequest(resourceGroupName, clusterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Request the status of all nodes in the cluster (as returned by 'nodetool status').
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response FetchNodeStatus(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateFetchNodeStatusRequest(resourceGroupName, clusterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateListBackupsRequest(string resourceGroupName, string clusterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/backups", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// List the backups of this cluster that are available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task> ListBackupsAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateListBackupsRequest(resourceGroupName, clusterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListBackups value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = Models.ListBackups.DeserializeListBackups(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List the backups of this cluster that are available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response ListBackups(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateListBackupsRequest(resourceGroupName, clusterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListBackups value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = Models.ListBackups.DeserializeListBackups(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetBackupRequest(string resourceGroupName, string clusterName, string backupId)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/backups/", false);
+ uri.AppendPath(backupId, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Get the properties of an individual backup of this cluster that is available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Id of a restorable backup of a Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task> GetBackupAsync(string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (backupId == null)
+ {
+ throw new ArgumentNullException(nameof(backupId));
+ }
+
+ using var message = CreateGetBackupRequest(resourceGroupName, clusterName, backupId);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ BackupResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = BackupResource.DeserializeBackupResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get the properties of an individual backup of this cluster that is available to restore.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Id of a restorable backup of a Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response GetBackup(string resourceGroupName, string clusterName, string backupId, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (backupId == null)
+ {
+ throw new ArgumentNullException(nameof(backupId));
+ }
+
+ using var message = CreateGetBackupRequest(resourceGroupName, clusterName, backupId);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ BackupResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = BackupResource.DeserializeBackupResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersUpdateOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersUpdateOperation.cs
new file mode 100644
index 000000000000..2dd6c1a762b4
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClustersUpdateOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Updates some of the properties of a managed Cassandra cluster.
+ public partial class CassandraClustersUpdateOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraClustersUpdateOperation for mocking.
+ protected CassandraClustersUpdateOperation()
+ {
+ }
+
+ internal CassandraClustersUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraClustersUpdateOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ClusterResource Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ClusterResource.DeserializeClusterResource(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ClusterResource.DeserializeClusterResource(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersCreateUpdateOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersCreateUpdateOperation.cs
new file mode 100644
index 000000000000..25a9bef02786
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersCreateUpdateOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH.
+ public partial class CassandraDataCentersCreateUpdateOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraDataCentersCreateUpdateOperation for mocking.
+ protected CassandraDataCentersCreateUpdateOperation()
+ {
+ }
+
+ internal CassandraDataCentersCreateUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraDataCentersCreateUpdateOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override DataCenterResource Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ DataCenterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersDeleteOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersDeleteOperation.cs
new file mode 100644
index 000000000000..dda1bbd3faa4
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersDeleteOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Delete a managed Cassandra data center.
+ public partial class CassandraDataCentersDeleteOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraDataCentersDeleteOperation for mocking.
+ protected CassandraDataCentersDeleteOperation()
+ {
+ }
+
+ internal CassandraDataCentersDeleteOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraDataCentersDeleteOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersOperations.cs
new file mode 100644
index 000000000000..2cf221b7c19a
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersOperations.cs
@@ -0,0 +1,381 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// The CassandraDataCenters service client.
+ public partial class CassandraDataCentersOperations
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal CassandraDataCentersRestOperations RestClient { get; }
+
+ /// Initializes a new instance of CassandraDataCentersOperations for mocking.
+ protected CassandraDataCentersOperations()
+ {
+ }
+
+ /// Initializes a new instance of CassandraDataCentersOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ internal CassandraDataCentersOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ RestClient = new CassandraDataCentersRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Get the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.Get");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetAsync(resourceGroupName, clusterName, dataCenterName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ public virtual Response Get(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.Get");
+ scope.Start();
+ try
+ {
+ return RestClient.Get(resourceGroupName, clusterName, dataCenterName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List all data centers in a particular managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual AsyncPageable ListAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.List");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListAsync(resourceGroupName, clusterName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// List all data centers in a particular managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual Pageable List(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.List");
+ scope.Start();
+ try
+ {
+ var response = RestClient.List(resourceGroupName, clusterName, cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Delete a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartDeleteAsync(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartDelete");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.DeleteAsync(resourceGroupName, clusterName, dataCenterName, cancellationToken).ConfigureAwait(false);
+ return new CassandraDataCentersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, clusterName, dataCenterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Delete a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual CassandraDataCentersDeleteOperation StartDelete(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartDelete");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Delete(resourceGroupName, clusterName, dataCenterName, cancellationToken);
+ return new CassandraDataCentersDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequest(resourceGroupName, clusterName, dataCenterName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartCreateUpdateAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartCreateUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.CreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, cancellationToken).ConfigureAwait(false);
+ return new CassandraDataCentersCreateUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual CassandraDataCentersCreateUpdateOperation StartCreateUpdate(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartCreateUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.CreateUpdate(resourceGroupName, clusterName, dataCenterName, body, cancellationToken);
+ return new CassandraDataCentersCreateUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Update some of the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters to provide for specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartUpdateAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.UpdateAsync(resourceGroupName, clusterName, dataCenterName, body, cancellationToken).ConfigureAwait(false);
+ return new CassandraDataCentersUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Update some of the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters to provide for specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual CassandraDataCentersUpdateOperation StartUpdate(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraDataCentersOperations.StartUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.Update(resourceGroupName, clusterName, dataCenterName, body, cancellationToken);
+ return new CassandraDataCentersUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersRestOperations.cs
new file mode 100644
index 000000000000..8514523cf09b
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersRestOperations.cs
@@ -0,0 +1,521 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ internal partial class CassandraDataCentersRestOperations
+ {
+ private string subscriptionId;
+ private Uri endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of CassandraDataCentersRestOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ /// or is null.
+ public CassandraDataCentersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ if (subscriptionId == null)
+ {
+ throw new ArgumentNullException(nameof(subscriptionId));
+ }
+ endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateListRequest(string resourceGroupName, string clusterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/dataCenters", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// List all data centers in a particular managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task> ListAsync(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateListRequest(resourceGroupName, clusterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListDataCenters value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = ListDataCenters.DeserializeListDataCenters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List all data centers in a particular managed Cassandra cluster.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response List(string resourceGroupName, string clusterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+
+ using var message = CreateListRequest(resourceGroupName, clusterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ListDataCenters value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = ListDataCenters.DeserializeListDataCenters(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetRequest(string resourceGroupName, string clusterName, string dataCenterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/dataCenters/", false);
+ uri.AppendPath(dataCenterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Get the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task> GetAsync(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var message = CreateGetRequest(resourceGroupName, clusterName, dataCenterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataCenterResource value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response Get(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var message = CreateGetRequest(resourceGroupName, clusterName, dataCenterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ DataCenterResource value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string clusterName, string dataCenterName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/dataCenters/", false);
+ uri.AppendPath(dataCenterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Delete a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task DeleteAsync(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var message = CreateDeleteRequest(resourceGroupName, clusterName, dataCenterName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Delete a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response Delete(string resourceGroupName, string clusterName, string dataCenterName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+
+ using var message = CreateDeleteRequest(resourceGroupName, clusterName, dataCenterName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateUpdateRequest(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/dataCenters/", false);
+ uri.AppendPath(dataCenterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(body);
+ request.Content = content;
+ return message;
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task CreateUpdateAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateCreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// 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.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response CreateUpdate(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateCreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 201:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateUpdateRequest(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Patch;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/cassandraClusters/", false);
+ uri.AppendPath(clusterName, true);
+ uri.AppendPath("/dataCenters/", false);
+ uri.AppendPath(dataCenterName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(body);
+ request.Content = content;
+ return message;
+ }
+
+ /// Update some of the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters to provide for specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task UpdateAsync(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Update some of the properties of a managed Cassandra data center.
+ /// The name of the resource group. The name is case insensitive.
+ /// Managed Cassandra cluster name.
+ /// Data center name in a managed Cassandra cluster.
+ /// Parameters to provide for specifying the managed Cassandra data center.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response Update(string resourceGroupName, string clusterName, string dataCenterName, DataCenterResource body, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (clusterName == null)
+ {
+ throw new ArgumentNullException(nameof(clusterName));
+ }
+ if (dataCenterName == null)
+ {
+ throw new ArgumentNullException(nameof(dataCenterName));
+ }
+ if (body == null)
+ {
+ throw new ArgumentNullException(nameof(body));
+ }
+
+ using var message = CreateUpdateRequest(resourceGroupName, clusterName, dataCenterName, body);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersUpdateOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersUpdateOperation.cs
new file mode 100644
index 000000000000..876a97ffb120
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCentersUpdateOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Update some of the properties of a managed Cassandra data center.
+ public partial class CassandraDataCentersUpdateOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraDataCentersUpdateOperation for mocking.
+ protected CassandraDataCentersUpdateOperation()
+ {
+ }
+
+ internal CassandraDataCentersUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraDataCentersUpdateOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override DataCenterResource Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ DataCenterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return DataCenterResource.DeserializeDataCenterResource(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesCreateUpdateCassandraViewOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesCreateUpdateCassandraViewOperation.cs
new file mode 100644
index 000000000000..93ce14bfdd82
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesCreateUpdateCassandraViewOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Create or update an Azure Cosmos DB Cassandra View.
+ public partial class CassandraResourcesCreateUpdateCassandraViewOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraResourcesCreateUpdateCassandraViewOperation for mocking.
+ protected CassandraResourcesCreateUpdateCassandraViewOperation()
+ {
+ }
+
+ internal CassandraResourcesCreateUpdateCassandraViewOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraResourcesCreateUpdateCassandraViewOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override CassandraViewGetResults Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ CassandraViewGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return CassandraViewGetResults.DeserializeCassandraViewGetResults(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return CassandraViewGetResults.DeserializeCassandraViewGetResults(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesDeleteCassandraViewOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesDeleteCassandraViewOperation.cs
new file mode 100644
index 000000000000..12decf461f63
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesDeleteCassandraViewOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Deletes an existing Azure Cosmos DB Cassandra view.
+ public partial class CassandraResourcesDeleteCassandraViewOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraResourcesDeleteCassandraViewOperation for mocking.
+ protected CassandraResourcesDeleteCassandraViewOperation()
+ {
+ }
+
+ internal CassandraResourcesDeleteCassandraViewOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraResourcesDeleteCassandraViewOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToAutoscaleOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToAutoscaleOperation.cs
new file mode 100644
index 000000000000..a471c3abbdc3
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToAutoscaleOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale.
+ public partial class CassandraResourcesMigrateCassandraViewToAutoscaleOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraResourcesMigrateCassandraViewToAutoscaleOperation for mocking.
+ protected CassandraResourcesMigrateCassandraViewToAutoscaleOperation()
+ {
+ }
+
+ internal CassandraResourcesMigrateCassandraViewToAutoscaleOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraResourcesMigrateCassandraViewToAutoscaleOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ThroughputSettingsGetResults Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ThroughputSettingsGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToManualThroughputOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToManualThroughputOperation.cs
new file mode 100644
index 000000000000..ce32f47e8ffe
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesMigrateCassandraViewToManualThroughputOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput.
+ public partial class CassandraResourcesMigrateCassandraViewToManualThroughputOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraResourcesMigrateCassandraViewToManualThroughputOperation for mocking.
+ protected CassandraResourcesMigrateCassandraViewToManualThroughputOperation()
+ {
+ }
+
+ internal CassandraResourcesMigrateCassandraViewToManualThroughputOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraResourcesMigrateCassandraViewToManualThroughputOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ThroughputSettingsGetResults Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ThroughputSettingsGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs
index 8d3bff87cefc..12c57aecebf9 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesOperations.cs
@@ -32,9 +32,10 @@ protected CassandraResourcesOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal CassandraResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal CassandraResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new CassandraResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new CassandraResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -203,6 +204,90 @@ public virtual Response GetCassandraTableThroughpu
}
}
+ /// Gets the Cassandra view under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ public virtual async Task> GetCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.GetCassandraView");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets the Cassandra view under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ public virtual Response GetCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.GetCassandraView");
+ scope.Start();
+ try
+ {
+ return RestClient.GetCassandraView(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ public virtual async Task> GetCassandraViewThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.GetCassandraViewThroughput");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ public virtual Response GetCassandraViewThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.GetCassandraViewThroughput");
+ scope.Start();
+ try
+ {
+ return RestClient.GetCassandraViewThroughput(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
/// Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account.
/// The name of the resource group. The name is case insensitive.
/// Cosmos DB database account name.
@@ -349,6 +434,84 @@ Page FirstPageFunc(int? pageSizeHint)
return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
}
+ /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual AsyncPageable ListCassandraViewsAsync(string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.ListCassandraViews");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListCassandraViewsAsync(resourceGroupName, accountName, keyspaceName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual Pageable ListCassandraViews(string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.ListCassandraViews");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListCassandraViews(resourceGroupName, accountName, keyspaceName, cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
/// Create or update an Azure Cosmos DB Cassandra keyspace.
/// The name of the resource group. The name is case insensitive.
/// Cosmos DB database account name.
@@ -1138,5 +1301,425 @@ public virtual CassandraResourcesMigrateCassandraTableToManualThroughputOperatio
throw;
}
}
+
+ /// Create or update an Azure Cosmos DB Cassandra View.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The parameters to provide for the current Cassandra View.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public virtual async Task StartCreateUpdateCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (createUpdateCassandraViewParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateCassandraViewParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartCreateUpdateCassandraView");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.CreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, cancellationToken).ConfigureAwait(false);
+ return new CassandraResourcesCreateUpdateCassandraViewOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Create or update an Azure Cosmos DB Cassandra View.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The parameters to provide for the current Cassandra View.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public virtual CassandraResourcesCreateUpdateCassandraViewOperation StartCreateUpdateCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (createUpdateCassandraViewParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateCassandraViewParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartCreateUpdateCassandraView");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.CreateUpdateCassandraView(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, cancellationToken);
+ return new CassandraResourcesCreateUpdateCassandraViewOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes an existing Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartDeleteCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartDeleteCassandraView");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.DeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken).ConfigureAwait(false);
+ return new CassandraResourcesDeleteCassandraViewOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes an existing Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual CassandraResourcesDeleteCassandraViewOperation StartDeleteCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartDeleteCassandraView");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.DeleteCassandraView(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken);
+ return new CassandraResourcesDeleteCassandraViewOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Update RUs per second of an Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The RUs per second of the parameters to provide for the current Cassandra view.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public virtual async Task StartUpdateCassandraViewThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (updateThroughputParameters == null)
+ {
+ throw new ArgumentNullException(nameof(updateThroughputParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartUpdateCassandraViewThroughput");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.UpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, cancellationToken).ConfigureAwait(false);
+ return new CassandraResourcesUpdateCassandraViewThroughputOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Update RUs per second of an Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The RUs per second of the parameters to provide for the current Cassandra view.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public virtual CassandraResourcesUpdateCassandraViewThroughputOperation StartUpdateCassandraViewThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (updateThroughputParameters == null)
+ {
+ throw new ArgumentNullException(nameof(updateThroughputParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartUpdateCassandraViewThroughput");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.UpdateCassandraViewThroughput(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, cancellationToken);
+ return new CassandraResourcesUpdateCassandraViewThroughputOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartMigrateCassandraViewToAutoscaleAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartMigrateCassandraViewToAutoscale");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.MigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken).ConfigureAwait(false);
+ return new CassandraResourcesMigrateCassandraViewToAutoscaleOperation(_clientDiagnostics, _pipeline, RestClient.CreateMigrateCassandraViewToAutoscaleRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual CassandraResourcesMigrateCassandraViewToAutoscaleOperation StartMigrateCassandraViewToAutoscale(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartMigrateCassandraViewToAutoscale");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.MigrateCassandraViewToAutoscale(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken);
+ return new CassandraResourcesMigrateCassandraViewToAutoscaleOperation(_clientDiagnostics, _pipeline, RestClient.CreateMigrateCassandraViewToAutoscaleRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartMigrateCassandraViewToManualThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartMigrateCassandraViewToManualThroughput");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.MigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken).ConfigureAwait(false);
+ return new CassandraResourcesMigrateCassandraViewToManualThroughputOperation(_clientDiagnostics, _pipeline, RestClient.CreateMigrateCassandraViewToManualThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual CassandraResourcesMigrateCassandraViewToManualThroughputOperation StartMigrateCassandraViewToManualThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("CassandraResourcesOperations.StartMigrateCassandraViewToManualThroughput");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.MigrateCassandraViewToManualThroughput(resourceGroupName, accountName, keyspaceName, viewName, cancellationToken);
+ return new CassandraResourcesMigrateCassandraViewToManualThroughputOperation(_clientDiagnostics, _pipeline, RestClient.CreateMigrateCassandraViewToManualThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
}
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs
index 65affea08a53..439fa045497a 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class CassandraResourcesRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class CassandraResourcesRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public CassandraResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public CassandraResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -57,7 +64,7 @@ internal HttpMessage CreateListCassandraKeyspacesRequest(string resourceGroupNam
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/cassandraKeyspaces", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -142,7 +149,7 @@ internal HttpMessage CreateGetCassandraKeyspaceRequest(string resourceGroupName,
uri.AppendPath(accountName, true);
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -237,7 +244,7 @@ internal HttpMessage CreateCreateUpdateCassandraKeyspaceRequest(string resourceG
uri.AppendPath(accountName, true);
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -338,7 +345,7 @@ internal HttpMessage CreateDeleteCassandraKeyspaceRequest(string resourceGroupNa
uri.AppendPath(accountName, true);
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
@@ -425,7 +432,7 @@ internal HttpMessage CreateGetCassandraKeyspaceThroughputRequest(string resource
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/throughputSettings/default", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -521,7 +528,7 @@ internal HttpMessage CreateUpdateCassandraKeyspaceThroughputRequest(string resou
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/throughputSettings/default", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -623,7 +630,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToAutoscaleRequest(string res
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -711,7 +718,7 @@ internal HttpMessage CreateMigrateCassandraKeyspaceToManualThroughputRequest(str
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -799,7 +806,7 @@ internal HttpMessage CreateListCassandraTablesRequest(string resourceGroupName,
uri.AppendPath("/cassandraKeyspaces/", false);
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/tables", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -896,7 +903,7 @@ internal HttpMessage CreateGetCassandraTableRequest(string resourceGroupName, st
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1003,7 +1010,7 @@ internal HttpMessage CreateCreateUpdateCassandraTableRequest(string resourceGrou
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -1116,7 +1123,7 @@ internal HttpMessage CreateDeleteCassandraTableRequest(string resourceGroupName,
uri.AppendPath(keyspaceName, true);
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
@@ -1215,7 +1222,7 @@ internal HttpMessage CreateGetCassandraTableThroughputRequest(string resourceGro
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
uri.AppendPath("/throughputSettings/default", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1323,7 +1330,7 @@ internal HttpMessage CreateUpdateCassandraTableThroughputRequest(string resource
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
uri.AppendPath("/throughputSettings/default", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -1437,7 +1444,7 @@ internal HttpMessage CreateMigrateCassandraTableToAutoscaleRequest(string resour
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1537,7 +1544,7 @@ internal HttpMessage CreateMigrateCassandraTableToManualThroughputRequest(string
uri.AppendPath("/tables/", false);
uri.AppendPath(tableName, true);
uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1618,5 +1625,843 @@ public Response MigrateCassandraTableToManualThroughput(string resourceGroupName
throw _clientDiagnostics.CreateRequestFailedException(message.Response);
}
}
+
+ internal HttpMessage CreateListCassandraViewsRequest(string resourceGroupName, string accountName, string keyspaceName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public async Task> ListCassandraViewsAsync(string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+
+ using var message = CreateListCassandraViewsRequest(resourceGroupName, accountName, keyspaceName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ CassandraViewListResult value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists the Cassandra materialized views under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public Response ListCassandraViews(string resourceGroupName, string accountName, string keyspaceName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+
+ using var message = CreateListCassandraViewsRequest(resourceGroupName, accountName, keyspaceName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ CassandraViewListResult value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = CassandraViewListResult.DeserializeCassandraViewListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetCassandraViewRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Gets the Cassandra view under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task> GetCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateGetCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ CassandraViewGetResults value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = CassandraViewGetResults.DeserializeCassandraViewGetResults(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Gets the Cassandra view under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response GetCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateGetCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ CassandraViewGetResults value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = CassandraViewGetResults.DeserializeCassandraViewGetResults(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateCreateUpdateCassandraViewRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(createUpdateCassandraViewParameters);
+ request.Content = content;
+ return message;
+ }
+
+ /// Create or update an Azure Cosmos DB Cassandra View.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The parameters to provide for the current Cassandra View.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public async Task CreateUpdateCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (createUpdateCassandraViewParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateCassandraViewParameters));
+ }
+
+ using var message = CreateCreateUpdateCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Create or update an Azure Cosmos DB Cassandra View.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The parameters to provide for the current Cassandra View.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public Response CreateUpdateCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (createUpdateCassandraViewParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateCassandraViewParameters));
+ }
+
+ using var message = CreateCreateUpdateCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateDeleteCassandraViewRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Delete;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ return message;
+ }
+
+ /// Deletes an existing Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task DeleteCassandraViewAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateDeleteCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Deletes an existing Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response DeleteCassandraView(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateDeleteCassandraViewRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ case 204:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetCassandraViewThroughputRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendPath("/throughputSettings/default", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task> GetCassandraViewThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateGetCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ThroughputSettingsGetResults value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response GetCassandraViewThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateGetCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ ThroughputSettingsGetResults value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateUpdateCassandraViewThroughputRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateParameters updateThroughputParameters)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Put;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendPath("/throughputSettings/default", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ request.Headers.Add("Content-Type", "application/json");
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(updateThroughputParameters);
+ request.Content = content;
+ return message;
+ }
+
+ /// Update RUs per second of an Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The RUs per second of the parameters to provide for the current Cassandra view.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public async Task UpdateCassandraViewThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (updateThroughputParameters == null)
+ {
+ throw new ArgumentNullException(nameof(updateThroughputParameters));
+ }
+
+ using var message = CreateUpdateCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Update RUs per second of an Azure Cosmos DB Cassandra view.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The RUs per second of the parameters to provide for the current Cassandra view.
+ /// The cancellation token to use.
+ /// , , , , or is null.
+ public Response UpdateCassandraViewThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+ if (updateThroughputParameters == null)
+ {
+ throw new ArgumentNullException(nameof(updateThroughputParameters));
+ }
+
+ using var message = CreateUpdateCassandraViewThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateMigrateCassandraViewToAutoscaleRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendPath("/throughputSettings/default/migrateToAutoscale", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task MigrateCassandraViewToAutoscaleAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateMigrateCassandraViewToAutoscaleRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response MigrateCassandraViewToAutoscale(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateMigrateCassandraViewToAutoscaleRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateMigrateCassandraViewToManualThroughputRequest(string resourceGroupName, string accountName, string keyspaceName, string viewName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Post;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/cassandraKeyspaces/", false);
+ uri.AppendPath(keyspaceName, true);
+ uri.AppendPath("/views/", false);
+ uri.AppendPath(viewName, true);
+ uri.AppendPath("/throughputSettings/default/migrateToManualThroughput", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public async Task MigrateCassandraViewToManualThroughputAsync(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateMigrateCassandraViewToManualThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB keyspace name.
+ /// Cosmos DB view name.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public Response MigrateCassandraViewToManualThroughput(string resourceGroupName, string accountName, string keyspaceName, string viewName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (keyspaceName == null)
+ {
+ throw new ArgumentNullException(nameof(keyspaceName));
+ }
+ if (viewName == null)
+ {
+ throw new ArgumentNullException(nameof(viewName));
+ }
+
+ using var message = CreateMigrateCassandraViewToManualThroughputRequest(resourceGroupName, accountName, keyspaceName, viewName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ case 202:
+ return message.Response;
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
}
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesUpdateCassandraViewThroughputOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesUpdateCassandraViewThroughputOperation.cs
new file mode 100644
index 000000000000..df9e8d9bf500
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraResourcesUpdateCassandraViewThroughputOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Update RUs per second of an Azure Cosmos DB Cassandra view.
+ public partial class CassandraResourcesUpdateCassandraViewThroughputOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of CassandraResourcesUpdateCassandraViewThroughputOperation for mocking.
+ protected CassandraResourcesUpdateCassandraViewThroughputOperation()
+ {
+ }
+
+ internal CassandraResourcesUpdateCassandraViewThroughputOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "CassandraResourcesUpdateCassandraViewThroughputOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override ThroughputSettingsGetResults Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ ThroughputSettingsGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return ThroughputSettingsGetResults.DeserializeThroughputSettingsGetResults(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs
index 852c76cebd5a..24186466e659 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionOperations.cs
@@ -32,9 +32,10 @@ protected CollectionOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal CollectionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal CollectionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new CollectionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new CollectionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs
index 916163a39db5..1c5388df3da0 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionOperations.cs
@@ -32,9 +32,10 @@ protected CollectionPartitionOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal CollectionPartitionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal CollectionPartitionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new CollectionPartitionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new CollectionPartitionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
index 10e3190819f7..3b21fbb31e04 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
@@ -32,9 +32,10 @@ protected CollectionPartitionRegionOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal CollectionPartitionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal CollectionPartitionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new CollectionPartitionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new CollectionPartitionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs
index 5fdd6957566d..952ff992e0b3 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRegionRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class CollectionPartitionRegionRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class CollectionPartitionRegionRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public CollectionPartitionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public CollectionPartitionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -63,7 +70,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/partitions/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs
index 366fb293e0d5..770ef170bf4f 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionPartitionRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class CollectionPartitionRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class CollectionPartitionRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public CollectionPartitionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public CollectionPartitionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -61,7 +68,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/partitions/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -180,7 +187,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/partitions/usages", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
if (filter != null)
{
uri.AppendQuery("$filter", filter, true);
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs
index d913d7992cc6..55e80ecefadb 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionOperations.cs
@@ -32,9 +32,10 @@ protected CollectionRegionOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal CollectionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal CollectionRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new CollectionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new CollectionRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs
index c7d5f05ffaf8..50ced1166bc4 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRegionRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class CollectionRegionRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class CollectionRegionRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public CollectionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public CollectionRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -63,7 +70,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs
index b72bb74763d1..69cde9dd7aa6 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CollectionRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class CollectionRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class CollectionRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public CollectionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public CollectionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -61,7 +68,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -180,7 +187,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/usages", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
if (filter != null)
{
uri.AppendQuery("$filter", filter, true);
@@ -294,7 +301,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName
uri.AppendPath("/collections/", false);
uri.AppendPath(collectionRid, true);
uri.AppendPath("/metricDefinitions", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs
index af5d2ec3251d..72c042da9b76 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementClient.cs
@@ -92,6 +92,9 @@ public CosmosDBManagementClient(string subscriptionId, Uri endpoint, TokenCreden
/// Returns an instance of PartitionKeyRangeIdRegionOperations.
public virtual PartitionKeyRangeIdRegionOperations PartitionKeyRangeIdRegion => new PartitionKeyRangeIdRegionOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+ /// Returns an instance of GraphResourcesOperations.
+ public virtual GraphResourcesOperations GraphResources => new GraphResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
/// Returns an instance of SqlResourcesOperations.
public virtual SqlResourcesOperations SqlResources => new SqlResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
@@ -107,13 +110,46 @@ public CosmosDBManagementClient(string subscriptionId, Uri endpoint, TokenCreden
/// Returns an instance of GremlinResourcesOperations.
public virtual GremlinResourcesOperations GremlinResources => new GremlinResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+ /// Returns an instance of CosmosDBManagementOperations.
+ public virtual CosmosDBManagementOperations CosmosDBManagement => new CosmosDBManagementOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
/// Returns an instance of NotebookWorkspacesOperations.
public virtual NotebookWorkspacesOperations NotebookWorkspaces => new NotebookWorkspacesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+ /// Returns an instance of PrivateEndpointConnectionsOperations.
+ public virtual PrivateEndpointConnectionsOperations PrivateEndpointConnections => new PrivateEndpointConnectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
/// Returns an instance of PrivateLinkResourcesOperations.
public virtual PrivateLinkResourcesOperations PrivateLinkResources => new PrivateLinkResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
- /// Returns an instance of PrivateEndpointConnectionsOperations.
- public virtual PrivateEndpointConnectionsOperations PrivateEndpointConnections => new PrivateEndpointConnectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+ /// Returns an instance of RestorableDatabaseAccountsOperations.
+ public virtual RestorableDatabaseAccountsOperations RestorableDatabaseAccounts => new RestorableDatabaseAccountsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableSqlDatabasesOperations.
+ public virtual RestorableSqlDatabasesOperations RestorableSqlDatabases => new RestorableSqlDatabasesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableSqlContainersOperations.
+ public virtual RestorableSqlContainersOperations RestorableSqlContainers => new RestorableSqlContainersOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableSqlResourcesOperations.
+ public virtual RestorableSqlResourcesOperations RestorableSqlResources => new RestorableSqlResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableMongodbDatabasesOperations.
+ public virtual RestorableMongodbDatabasesOperations RestorableMongodbDatabases => new RestorableMongodbDatabasesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableMongodbCollectionsOperations.
+ public virtual RestorableMongodbCollectionsOperations RestorableMongodbCollections => new RestorableMongodbCollectionsOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of RestorableMongodbResourcesOperations.
+ public virtual RestorableMongodbResourcesOperations RestorableMongodbResources => new RestorableMongodbResourcesOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of CassandraClustersOperations.
+ public virtual CassandraClustersOperations CassandraClusters => new CassandraClustersOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of CassandraDataCentersOperations.
+ public virtual CassandraDataCentersOperations CassandraDataCenters => new CassandraDataCentersOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
+
+ /// Returns an instance of ServiceOperations.
+ public virtual ServiceOperations Service => new ServiceOperations(_clientDiagnostics, _pipeline, _subscriptionId, _endpoint);
}
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementOperations.cs
new file mode 100644
index 000000000000..5460633991b7
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementOperations.cs
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// The CosmosDBManagement service client.
+ public partial class CosmosDBManagementOperations
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal CosmosDBManagementRestOperations RestClient { get; }
+
+ /// Initializes a new instance of CosmosDBManagementOperations for mocking.
+ protected CosmosDBManagementOperations()
+ {
+ }
+
+ /// Initializes a new instance of CosmosDBManagementOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ internal CosmosDBManagementOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ RestClient = new CosmosDBManagementRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Get the properties of an existing Cosmos DB location.
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ /// The cancellation token to use.
+ public virtual async Task> LocationGetAsync(string location, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CosmosDBManagementOperations.LocationGet");
+ scope.Start();
+ try
+ {
+ return await RestClient.LocationGetAsync(location, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get the properties of an existing Cosmos DB location.
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ /// The cancellation token to use.
+ public virtual Response LocationGet(string location, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CosmosDBManagementOperations.LocationGet");
+ scope.Start();
+ try
+ {
+ return RestClient.LocationGet(location, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// List Cosmos DB locations and their properties.
+ /// The cancellation token to use.
+ public virtual AsyncPageable LocationListAsync(CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CosmosDBManagementOperations.LocationList");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.LocationListAsync(cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// List Cosmos DB locations and their properties.
+ /// The cancellation token to use.
+ public virtual Pageable LocationList(CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("CosmosDBManagementOperations.LocationList");
+ scope.Start();
+ try
+ {
+ var response = RestClient.LocationList(cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementRestOperations.cs
new file mode 100644
index 000000000000..5155539eba92
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBManagementRestOperations.cs
@@ -0,0 +1,180 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ internal partial class CosmosDBManagementRestOperations
+ {
+ private string subscriptionId;
+ private Uri endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of CosmosDBManagementRestOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ /// or is null.
+ public CosmosDBManagementRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ if (subscriptionId == null)
+ {
+ throw new ArgumentNullException(nameof(subscriptionId));
+ }
+ endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateLocationListRequest()
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/locations", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// List Cosmos DB locations and their properties.
+ /// The cancellation token to use.
+ public async Task> LocationListAsync(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateLocationListRequest();
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LocationListResult value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = LocationListResult.DeserializeLocationListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// List Cosmos DB locations and their properties.
+ /// The cancellation token to use.
+ public Response LocationList(CancellationToken cancellationToken = default)
+ {
+ using var message = CreateLocationListRequest();
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LocationListResult value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = LocationListResult.DeserializeLocationListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateLocationGetRequest(string location)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/locations/", false);
+ uri.AppendPath(location, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Get the properties of an existing Cosmos DB location.
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ /// The cancellation token to use.
+ /// is null.
+ public async Task> LocationGetAsync(string location, CancellationToken cancellationToken = default)
+ {
+ if (location == null)
+ {
+ throw new ArgumentNullException(nameof(location));
+ }
+
+ using var message = CreateLocationGetRequest(location);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LocationGetResult value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = LocationGetResult.DeserializeLocationGetResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Get the properties of an existing Cosmos DB location.
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ /// The cancellation token to use.
+ /// is null.
+ public Response LocationGet(string location, CancellationToken cancellationToken = default)
+ {
+ if (location == null)
+ {
+ throw new ArgumentNullException(nameof(location));
+ }
+
+ using var message = CreateLocationGetRequest(location);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ LocationGetResult value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = LocationGetResult.DeserializeLocationGetResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
index 44b309c59e0a..4c44e6be273c 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
@@ -32,9 +32,10 @@ protected DatabaseAccountRegionOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal DatabaseAccountRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal DatabaseAccountRegionOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new DatabaseAccountRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new DatabaseAccountRegionRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs
index 3cb832ca8215..9a83c7ca1942 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountRegionRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class DatabaseAccountRegionRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class DatabaseAccountRegionRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public DatabaseAccountRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public DatabaseAccountRegionRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -59,7 +66,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/region/", false);
uri.AppendPath(region, true);
uri.AppendPath("/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
index 038b9b87d7de..7938b649f414 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
@@ -32,9 +32,10 @@ protected DatabaseAccountsOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal DatabaseAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal DatabaseAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new DatabaseAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new DatabaseAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs
index a6edc34e0c45..2f1160ef3977 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseAccountsRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class DatabaseAccountsRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class DatabaseAccountsRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public DatabaseAccountsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public DatabaseAccountsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -56,7 +63,7 @@ internal HttpMessage CreateGetRequest(string resourceGroupName, string accountNa
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -139,7 +146,7 @@ internal HttpMessage CreateUpdateRequest(string resourceGroupName, string accoun
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -226,7 +233,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, strin
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -313,7 +320,7 @@ internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accoun
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
@@ -388,7 +395,7 @@ internal HttpMessage CreateFailoverPriorityChangeRequest(string resourceGroupNam
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/failoverPriorityChange", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
var content = new Utf8JsonRequestContent();
@@ -473,7 +480,7 @@ internal HttpMessage CreateListRequest()
uri.AppendPath("/subscriptions/", false);
uri.AppendPath(subscriptionId, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -531,7 +538,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
uri.AppendPath("/resourceGroups/", false);
uri.AppendPath(resourceGroupName, true);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -605,7 +612,7 @@ internal HttpMessage CreateListKeysRequest(string resourceGroupName, string acco
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/listKeys", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -689,7 +696,7 @@ internal HttpMessage CreateListConnectionStringsRequest(string resourceGroupName
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/listConnectionStrings", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -773,7 +780,7 @@ internal HttpMessage CreateOfflineRegionRequest(string resourceGroupName, string
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/offlineRegion", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -863,7 +870,7 @@ internal HttpMessage CreateOnlineRegionRequest(string resourceGroupName, string
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/onlineRegion", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Content-Type", "application/json");
@@ -953,7 +960,7 @@ internal HttpMessage CreateGetReadOnlyKeysRequest(string resourceGroupName, stri
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/readonlykeys", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1037,7 +1044,7 @@ internal HttpMessage CreateListReadOnlyKeysRequest(string resourceGroupName, str
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/readonlykeys", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
@@ -1121,7 +1128,7 @@ internal HttpMessage CreateRegenerateKeyRequest(string resourceGroupName, string
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/regenerateKey", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Content-Type", "application/json");
var content = new Utf8JsonRequestContent();
@@ -1205,7 +1212,7 @@ internal HttpMessage CreateCheckNameExistsRequest(string accountName)
uri.Reset(endpoint);
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccountNames/", false);
uri.AppendPath(accountName, true);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
return message;
}
@@ -1284,7 +1291,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -1379,7 +1386,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/usages", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
if (filter != null)
{
uri.AppendQuery("$filter", filter, true);
@@ -1469,7 +1476,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName
uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
uri.AppendPath(accountName, true);
uri.AppendPath("/metricDefinitions", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs
index b903935f3b70..6896ec151354 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseOperations.cs
@@ -32,9 +32,10 @@ protected DatabaseOperations()
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- internal DatabaseOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ internal DatabaseOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
- RestClient = new DatabaseRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
+ RestClient = new DatabaseRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs
index 555673f2c5d1..628185df7012 100644
--- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DatabaseRestOperations.cs
@@ -20,6 +20,7 @@ internal partial class DatabaseRestOperations
{
private string subscriptionId;
private Uri endpoint;
+ private string apiVersion;
private ClientDiagnostics _clientDiagnostics;
private HttpPipeline _pipeline;
@@ -28,17 +29,23 @@ internal partial class DatabaseRestOperations
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The ID of the target subscription.
/// server parameter.
- /// is null.
- public DatabaseRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null)
+ /// Api Version.
+ /// or is null.
+ public DatabaseRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
{
if (subscriptionId == null)
{
throw new ArgumentNullException(nameof(subscriptionId));
}
endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
_clientDiagnostics = clientDiagnostics;
_pipeline = pipeline;
}
@@ -59,7 +66,7 @@ internal HttpMessage CreateListMetricsRequest(string resourceGroupName, string a
uri.AppendPath("/databases/", false);
uri.AppendPath(databaseRid, true);
uri.AppendPath("/metrics", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
uri.AppendQuery("$filter", filter, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
@@ -166,7 +173,7 @@ internal HttpMessage CreateListUsagesRequest(string resourceGroupName, string ac
uri.AppendPath("/databases/", false);
uri.AppendPath(databaseRid, true);
uri.AppendPath("/usages", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
if (filter != null)
{
uri.AppendQuery("$filter", filter, true);
@@ -268,7 +275,7 @@ internal HttpMessage CreateListMetricDefinitionsRequest(string resourceGroupName
uri.AppendPath("/databases/", false);
uri.AppendPath(databaseRid, true);
uri.AppendPath("/metricDefinitions", false);
- uri.AppendQuery("api-version", "2020-04-01", true);
+ uri.AppendQuery("api-version", apiVersion, true);
request.Uri = uri;
request.Headers.Add("Accept", "application/json");
return message;
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesCreateUpdateGraphOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesCreateUpdateGraphOperation.cs
new file mode 100644
index 000000000000..c890d10c4a6d
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesCreateUpdateGraphOperation.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Create or update an Azure Cosmos DB Graph.
+ public partial class GraphResourcesCreateUpdateGraphOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of GraphResourcesCreateUpdateGraphOperation for mocking.
+ protected GraphResourcesCreateUpdateGraphOperation()
+ {
+ }
+
+ internal GraphResourcesCreateUpdateGraphOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "GraphResourcesCreateUpdateGraphOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override GraphResourceGetResults Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ GraphResourceGetResults IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ using var document = JsonDocument.Parse(response.ContentStream);
+ return GraphResourceGetResults.DeserializeGraphResourceGetResults(document.RootElement);
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ return GraphResourceGetResults.DeserializeGraphResourceGetResults(document.RootElement);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesDeleteGraphResourceOperation.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesDeleteGraphResourceOperation.cs
new file mode 100644
index 000000000000..1ac83ff295a1
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesDeleteGraphResourceOperation.cs
@@ -0,0 +1,68 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// Deletes an existing Azure Cosmos DB Graph Resource.
+ public partial class GraphResourcesDeleteGraphResourceOperation : Operation, IOperationSource
+ {
+ private readonly ArmOperationHelpers _operation;
+
+ /// Initializes a new instance of GraphResourcesDeleteGraphResourceOperation for mocking.
+ protected GraphResourcesDeleteGraphResourceOperation()
+ {
+ }
+
+ internal GraphResourcesDeleteGraphResourceOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response)
+ {
+ _operation = new ArmOperationHelpers(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "GraphResourcesDeleteGraphResourceOperation");
+ }
+ ///
+ public override string Id => _operation.Id;
+
+ ///
+ public override Response Value => _operation.Value;
+
+ ///
+ public override bool HasCompleted => _operation.HasCompleted;
+
+ ///
+ public override bool HasValue => _operation.HasValue;
+
+ ///
+ public override Response GetRawResponse() => _operation.GetRawResponse();
+
+ ///
+ public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken);
+
+ ///
+ public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken);
+
+ ///
+ public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken);
+
+ Response IOperationSource.CreateResult(Response response, CancellationToken cancellationToken)
+ {
+ return response;
+ }
+
+ async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken)
+ {
+ return await new ValueTask(response).ConfigureAwait(false);
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesOperations.cs
new file mode 100644
index 000000000000..d88d2909c484
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesOperations.cs
@@ -0,0 +1,301 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ /// The GraphResources service client.
+ public partial class GraphResourcesOperations
+ {
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+ internal GraphResourcesRestOperations RestClient { get; }
+
+ /// Initializes a new instance of GraphResourcesOperations for mocking.
+ protected GraphResourcesOperations()
+ {
+ }
+
+ /// Initializes a new instance of GraphResourcesOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ internal GraphResourcesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ RestClient = new GraphResourcesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The cancellation token to use.
+ public virtual async Task> GetGraphAsync(string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.GetGraph");
+ scope.Start();
+ try
+ {
+ return await RestClient.GetGraphAsync(resourceGroupName, accountName, graphName, cancellationToken).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The cancellation token to use.
+ public virtual Response GetGraph(string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.GetGraph");
+ scope.Start();
+ try
+ {
+ return RestClient.GetGraph(resourceGroupName, accountName, graphName, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Lists the graphs under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual AsyncPageable ListGraphsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.ListGraphs");
+ scope.Start();
+ try
+ {
+ var response = await RestClient.ListGraphsAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// Lists the graphs under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// The cancellation token to use.
+ /// or is null.
+ public virtual Pageable ListGraphs(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.ListGraphs");
+ scope.Start();
+ try
+ {
+ var response = RestClient.ListGraphs(resourceGroupName, accountName, cancellationToken);
+ return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Create or update an Azure Cosmos DB Graph.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The parameters to provide for the current graph.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual async Task StartCreateUpdateGraphAsync(string resourceGroupName, string accountName, string graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (graphName == null)
+ {
+ throw new ArgumentNullException(nameof(graphName));
+ }
+ if (createUpdateGraphParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateGraphParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.StartCreateUpdateGraph");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.CreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, cancellationToken).ConfigureAwait(false);
+ return new GraphResourcesCreateUpdateGraphOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateGraphRequest(resourceGroupName, accountName, graphName, createUpdateGraphParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Create or update an Azure Cosmos DB Graph.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The parameters to provide for the current graph.
+ /// The cancellation token to use.
+ /// , , , or is null.
+ public virtual GraphResourcesCreateUpdateGraphOperation StartCreateUpdateGraph(string resourceGroupName, string accountName, string graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (graphName == null)
+ {
+ throw new ArgumentNullException(nameof(graphName));
+ }
+ if (createUpdateGraphParameters == null)
+ {
+ throw new ArgumentNullException(nameof(createUpdateGraphParameters));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.StartCreateUpdateGraph");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.CreateUpdateGraph(resourceGroupName, accountName, graphName, createUpdateGraphParameters, cancellationToken);
+ return new GraphResourcesCreateUpdateGraphOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateUpdateGraphRequest(resourceGroupName, accountName, graphName, createUpdateGraphParameters).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes an existing Azure Cosmos DB Graph Resource.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual async Task StartDeleteGraphResourceAsync(string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (graphName == null)
+ {
+ throw new ArgumentNullException(nameof(graphName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.StartDeleteGraphResource");
+ scope.Start();
+ try
+ {
+ var originalResponse = await RestClient.DeleteGraphResourceAsync(resourceGroupName, accountName, graphName, cancellationToken).ConfigureAwait(false);
+ return new GraphResourcesDeleteGraphResourceOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteGraphResourceRequest(resourceGroupName, accountName, graphName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Deletes an existing Azure Cosmos DB Graph Resource.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The cancellation token to use.
+ /// , , or is null.
+ public virtual GraphResourcesDeleteGraphResourceOperation StartDeleteGraphResource(string resourceGroupName, string accountName, string graphName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (graphName == null)
+ {
+ throw new ArgumentNullException(nameof(graphName));
+ }
+
+ using var scope = _clientDiagnostics.CreateScope("GraphResourcesOperations.StartDeleteGraphResource");
+ scope.Start();
+ try
+ {
+ var originalResponse = RestClient.DeleteGraphResource(resourceGroupName, accountName, graphName, cancellationToken);
+ return new GraphResourcesDeleteGraphResourceOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteGraphResourceRequest(resourceGroupName, accountName, graphName).Request, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesRestOperations.cs
new file mode 100644
index 000000000000..38943509c239
--- /dev/null
+++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourcesRestOperations.cs
@@ -0,0 +1,421 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.CosmosDB.Models;
+
+namespace Azure.ResourceManager.CosmosDB
+{
+ internal partial class GraphResourcesRestOperations
+ {
+ private string subscriptionId;
+ private Uri endpoint;
+ private string apiVersion;
+ private ClientDiagnostics _clientDiagnostics;
+ private HttpPipeline _pipeline;
+
+ /// Initializes a new instance of GraphResourcesRestOperations.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The ID of the target subscription.
+ /// server parameter.
+ /// Api Version.
+ /// or is null.
+ public GraphResourcesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2021-07-01-preview")
+ {
+ if (subscriptionId == null)
+ {
+ throw new ArgumentNullException(nameof(subscriptionId));
+ }
+ endpoint ??= new Uri("https://management.azure.com");
+ if (apiVersion == null)
+ {
+ throw new ArgumentNullException(nameof(apiVersion));
+ }
+
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = apiVersion;
+ _clientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ }
+
+ internal HttpMessage CreateListGraphsRequest(string resourceGroupName, string accountName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/graphs", false);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Lists the graphs under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// The cancellation token to use.
+ /// or is null.
+ public async Task> ListGraphsAsync(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ using var message = CreateListGraphsRequest(resourceGroupName, accountName);
+ await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ GraphResourcesListResult value = default;
+ using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
+ value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
+ }
+ }
+
+ /// Lists the graphs under an existing Azure Cosmos DB database account.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// The cancellation token to use.
+ /// or is null.
+ public Response ListGraphs(string resourceGroupName, string accountName, CancellationToken cancellationToken = default)
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ArgumentNullException(nameof(resourceGroupName));
+ }
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ using var message = CreateListGraphsRequest(resourceGroupName, accountName);
+ _pipeline.Send(message, cancellationToken);
+ switch (message.Response.Status)
+ {
+ case 200:
+ {
+ GraphResourcesListResult value = default;
+ using var document = JsonDocument.Parse(message.Response.ContentStream);
+ value = GraphResourcesListResult.DeserializeGraphResourcesListResult(document.RootElement);
+ return Response.FromValue(value, message.Response);
+ }
+ default:
+ throw _clientDiagnostics.CreateRequestFailedException(message.Response);
+ }
+ }
+
+ internal HttpMessage CreateGetGraphRequest(string resourceGroupName, string accountName, string graphName)
+ {
+ var message = _pipeline.CreateMessage();
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(endpoint);
+ uri.AppendPath("/subscriptions/", false);
+ uri.AppendPath(subscriptionId, true);
+ uri.AppendPath("/resourceGroups/", false);
+ uri.AppendPath(resourceGroupName, true);
+ uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false);
+ uri.AppendPath(accountName, true);
+ uri.AppendPath("/graphs/", false);
+ uri.AppendPath(graphName, true);
+ uri.AppendQuery("api-version", apiVersion, true);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ /// Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name.
+ /// The name of the resource group. The name is case insensitive.
+ /// Cosmos DB database account name.
+ /// Cosmos DB graph resource name.
+ /// The cancellation token to use.
+ ///